mirror of
https://github.com/Sunnyyoung/WeChatTweak-macOS.git
synced 2026-07-29 06:24:31 +08:00
Fix anti-revoke message cell mask style issue
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// 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>
|
||||
|
||||
@class MessageData;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface RecallCacheManager : NSObject
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
+ (void)insertRevokedMessage:(MessageData *)message;
|
||||
+ (BOOL)containsRevokedMessage:(MessageData *)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// RecallCacheManager.m
|
||||
// WeChatTweak
|
||||
//
|
||||
// Created by Sunny Young on 2019/8/29.
|
||||
// Copyright © 2019 Sunnyyoung. All rights reserved.
|
||||
//
|
||||
|
||||
#import "RecallCacheManager.h"
|
||||
#import "WeChatTweakHeaders.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)insertRevokedMessage:(MessageData *)message {
|
||||
NSString *identifer = [NSString stringWithFormat:@"%ud-%lld-%ud", message.mesLocalID, message.mesSvrID, message.msgCreateTime];
|
||||
[RecallCacheManager.sharedInstance.kv setBool:YES forKey:identifer];
|
||||
}
|
||||
|
||||
+ (BOOL)containsRevokedMessage:(MessageData *)message {
|
||||
NSString *identifer = [NSString stringWithFormat:@"%ud-%lld-%ud", message.mesLocalID, message.mesSvrID, message.msgCreateTime];
|
||||
return [RecallCacheManager.sharedInstance.kv containsKey:identifer];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,7 +11,7 @@
|
||||
#import <objc/message.h>
|
||||
|
||||
typedef NS_ENUM(NSUInteger, WTRevokedMessageStyle) {
|
||||
WTRevokedMessageStylePlain = 0,
|
||||
WTRevokedMessageStyleClassic = 0,
|
||||
WTRevokedMessageStyleMask
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user