mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2026-07-29 06:24:31 +08:00
Add recalled message tag UI enhancement
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// RecallCacheManager.h
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2019/8/29.
|
||||
// Copyright © 2019 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <MMKV/MMKV.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RecallCacheManager : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
+ (void)insertRevokedMessageID:(long long)messageID;
|
||||
+ (BOOL)containsRevokedMessageID:(long long)messageID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// RecallCacheManager.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2019/8/29.
|
||||
// Copyright © 2019 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RecallCacheManager.h"
|
||||
|
||||
@interface RecallCacheManager()
|
||||
|
||||
@property (nonatomic, strong) MMKV *kv;
|
||||
|
||||
@end
|
||||
|
||||
@implementation RecallCacheManager
|
||||
|
||||
- (instancetype)init {
|
||||
if (self = [super init]) {
|
||||
[MMKV setLogLevel:MMKVLogNone];
|
||||
_kv = [MMKV mmkvWithID:@"Recall.cache"];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance {
|
||||
static RecallCacheManager *shared;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
shared = [[RecallCacheManager alloc] init];
|
||||
});
|
||||
return shared;
|
||||
}
|
||||
|
||||
+ (void)insertRevokedMessageID:(long long)messageID {
|
||||
[RecallCacheManager.sharedInstance.kv setBool:YES forKey:@(messageID).stringValue];
|
||||
}
|
||||
|
||||
+ (BOOL)containsRevokedMessageID:(long long)messageID {
|
||||
return [RecallCacheManager.sharedInstance.kv containsKey:@(messageID).stringValue];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user