diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 04b32625..e90bf391 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,11 +1,12 @@ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Headers/WeChatPlugin.h b/Other/Products/Debug/WeChatPlugin.framework/Headers/WeChatPlugin.h index d7099276..c8422e55 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Headers/WeChatPlugin.h +++ b/Other/Products/Debug/WeChatPlugin.framework/Headers/WeChatPlugin.h @@ -191,6 +191,7 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @property(nonatomic) BOOL m_isMentionedUnread; // @synthesize @property(retain, nonatomic) NSString *m_nsUserName; // @synthesize m_nsUserName; @property(retain, nonatomic) MMSessionInfoPackedInfo *m_packedInfo; +@property(nonatomic) unsigned int m_uUnReadCount; @end @protocol MMChatsTableCellViewDelegate @@ -210,11 +211,14 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @interface MMSessionMgr : NSObject @property(retain, nonatomic) NSMutableArray *m_arrSession; - (id)GetSessionAtIndex:(unsigned long long)arg1; +- (id)sessionInfoByUserName:(id)arg1; - (void)MuteSessionByUserName:(id)arg1; +- (void)onUnReadCountChange:(id)arg1; //- (void)TopSessionByUserName:(id)arg1; - (void)UnmuteSessionByUserName:(id)arg1; - (void)UntopSessionByUserName:(id)arg1; - (void)deleteSessionWithoutSyncToServerWithUserName:(id)arg1; +- (void)changeSessionUnreadCountWithUserName:(id)arg1 to:(unsigned int)arg2; - (void)removeSessionOfUser:(id)arg1 isDelMsg:(BOOL)arg2; - (void)sortSessions; - (void)FFDataSvrMgrSvrFavZZ; @@ -232,6 +236,8 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @end @interface MMChatMessageViewController : NSViewController +@property(retain, nonatomic) WCContactData *chatContact; +- (void)onClickSession; @end @interface MMMessageTableItem : NSObject diff --git a/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist index 7eba8196..df3f0ed6 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist +++ b/Other/Products/Debug/WeChatPlugin.framework/Resources/Info.plist @@ -43,6 +43,6 @@ showUpdateWindow versionInfo - v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n + v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新(非AppStore版本)\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n diff --git a/Other/Products/Debug/WeChatPlugin.framework/Resources/en.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Resources/en.lproj/Localizable.strings index ac25f83b..50abd9fc 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Resources/en.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Resources/en.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hans.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hans.lproj/Localizable.strings index b8d84a3e..ae40fe95 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hans.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hans.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hant.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hant.lproj/Localizable.strings index 5a122b08..f73dbe00 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hant.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Resources/zh-Hant.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Headers/WeChatPlugin.h b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Headers/WeChatPlugin.h index d7099276..c8422e55 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Headers/WeChatPlugin.h +++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Headers/WeChatPlugin.h @@ -191,6 +191,7 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @property(nonatomic) BOOL m_isMentionedUnread; // @synthesize @property(retain, nonatomic) NSString *m_nsUserName; // @synthesize m_nsUserName; @property(retain, nonatomic) MMSessionInfoPackedInfo *m_packedInfo; +@property(nonatomic) unsigned int m_uUnReadCount; @end @protocol MMChatsTableCellViewDelegate @@ -210,11 +211,14 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @interface MMSessionMgr : NSObject @property(retain, nonatomic) NSMutableArray *m_arrSession; - (id)GetSessionAtIndex:(unsigned long long)arg1; +- (id)sessionInfoByUserName:(id)arg1; - (void)MuteSessionByUserName:(id)arg1; +- (void)onUnReadCountChange:(id)arg1; //- (void)TopSessionByUserName:(id)arg1; - (void)UnmuteSessionByUserName:(id)arg1; - (void)UntopSessionByUserName:(id)arg1; - (void)deleteSessionWithoutSyncToServerWithUserName:(id)arg1; +- (void)changeSessionUnreadCountWithUserName:(id)arg1 to:(unsigned int)arg2; - (void)removeSessionOfUser:(id)arg1 isDelMsg:(BOOL)arg2; - (void)sortSessions; - (void)FFDataSvrMgrSvrFavZZ; @@ -232,6 +236,8 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @end @interface MMChatMessageViewController : NSViewController +@property(retain, nonatomic) WCContactData *chatContact; +- (void)onClickSession; @end @interface MMMessageTableItem : NSObject diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist index 7eba8196..df3f0ed6 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist +++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/Info.plist @@ -43,6 +43,6 @@ showUpdateWindow versionInfo - v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n + v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新(非AppStore版本)\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/en.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/en.lproj/Localizable.strings index ac25f83b..50abd9fc 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/en.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/en.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hans.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hans.lproj/Localizable.strings index b8d84a3e..ae40fe95 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hans.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hans.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hant.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hant.lproj/Localizable.strings index 5a122b08..f73dbe00 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hant.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/Resources/zh-Hant.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin index 318609d2..79b9d05f 100755 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/Versions/A/WeChatPlugin differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Headers/WeChatPlugin.h b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Headers/WeChatPlugin.h index d7099276..c8422e55 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Headers/WeChatPlugin.h +++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Headers/WeChatPlugin.h @@ -191,6 +191,7 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @property(nonatomic) BOOL m_isMentionedUnread; // @synthesize @property(retain, nonatomic) NSString *m_nsUserName; // @synthesize m_nsUserName; @property(retain, nonatomic) MMSessionInfoPackedInfo *m_packedInfo; +@property(nonatomic) unsigned int m_uUnReadCount; @end @protocol MMChatsTableCellViewDelegate @@ -210,11 +211,14 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @interface MMSessionMgr : NSObject @property(retain, nonatomic) NSMutableArray *m_arrSession; - (id)GetSessionAtIndex:(unsigned long long)arg1; +- (id)sessionInfoByUserName:(id)arg1; - (void)MuteSessionByUserName:(id)arg1; +- (void)onUnReadCountChange:(id)arg1; //- (void)TopSessionByUserName:(id)arg1; - (void)UnmuteSessionByUserName:(id)arg1; - (void)UntopSessionByUserName:(id)arg1; - (void)deleteSessionWithoutSyncToServerWithUserName:(id)arg1; +- (void)changeSessionUnreadCountWithUserName:(id)arg1 to:(unsigned int)arg2; - (void)removeSessionOfUser:(id)arg1 isDelMsg:(BOOL)arg2; - (void)sortSessions; - (void)FFDataSvrMgrSvrFavZZ; @@ -232,6 +236,8 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @end @interface MMChatMessageViewController : NSViewController +@property(retain, nonatomic) WCContactData *chatContact; +- (void)onClickSession; @end @interface MMMessageTableItem : NSObject diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist index 7eba8196..df3f0ed6 100644 --- a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist +++ b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/Info.plist @@ -43,6 +43,6 @@ showUpdateWindow versionInfo - v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n + v1.7.5(2019-01-13):\n👉🏻 适配微信 Version. 2.3.22\n👉🏼 菜单栏新增是否允许微信启动时检测更新(非AppStore版本)\n👉🏽 优化 XML 解析\n\n\n\nv1.7.3 (2018-10-22):\n👉🏻 适配微信 Version. 2.3.19\n👉🏼 修复安全漏洞(请务必更新,若有安装QQ插件也需要更新)\n👉🏽 菜单栏-关于小助手-新增 alfred 开关(若不使用 aflred 可关闭) \n\nv1.7.1 (2018-07-24):\n👉🏻 适配微信 Version. 2.3.17\n👉🏼 新增 alfred 搜索最近聊天列表\n👉🏽 新增 alfred 查看用户聊天记录\n (需更新wechat-alfred-workflow)\n\nv1.7 (2018-05-12):\n👉🏻 新增不同账户设置不同的自动回复&远程控制\n👉🏼 自动回复新增总开关&指定联系人\n👉🏽 远程控制新增控制小助手配置\n👉🏾 新增一键已读\n👉 新增一键清除空回话\n👉🏻 新增国际化(支持英、简、繁)\n👉🏼 新增关于小助手\n👉🏽 新增在线更新小助手 \n👉🏾 去除微信url转链处理(从此直接打开抖音链接🌝 \n👉🏿 修复无法免认证登录&多开等bug \n diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/en.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/en.lproj/Localizable.strings index ac25f83b..50abd9fc 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/en.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/en.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hans.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hans.lproj/Localizable.strings index b8d84a3e..ae40fe95 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hans.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hans.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hant.lproj/Localizable.strings b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hant.lproj/Localizable.strings index 5a122b08..f73dbe00 100644 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hant.lproj/Localizable.strings and b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/Resources/zh-Hant.lproj/Localizable.strings differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin index 318609d2..79b9d05f 100755 Binary files a/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/Versions/Current/WeChatPlugin differ diff --git a/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin b/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin index 318609d2..79b9d05f 100755 Binary files a/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin and b/Other/Products/Debug/WeChatPlugin.framework/WeChatPlugin differ diff --git a/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index fbce6790..ed9a9b4d 100644 --- a/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/WeChatPlugin.xcworkspace/xcuserdata/TK.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -2,118 +2,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.h b/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.h index 80936dee..18a4f49e 100644 --- a/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.h +++ b/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.h @@ -25,9 +25,10 @@ @property (nonatomic, strong) NSMutableArray *autoReplyModels; /**< 自动回复的数组 */ @property (nonatomic, strong) NSMutableArray *remoteControlModels; /**< 远程控制的数组 */ @property (nonatomic, strong) NSMutableArray *ignoreSessionModels; /**< 聊天置底的数组 */ -@property (nonatomic, strong) NSMutableArray *selectSessions; /**< 已经选中的会话 */ -@property (nonatomic, strong) NSMutableSet *revokeMsgSet; /**< 撤回的消息集合 */ -@property (nonatomic, copy) NSString *currentUserName; /**< 当前用户的id */ +@property (nonatomic, strong) NSMutableArray *selectSessions; /**< 已经选中的会话 */ +@property (nonatomic, strong) NSMutableSet *revokeMsgSet; /**< 撤回的消息集合 */ +@property (nonatomic, strong) NSMutableSet *unreadSessionSet; /**< 标记未读消息集合 */ +@property (nonatomic, copy) NSString *currentUserName; /**< 当前用户的id */ @property (nonatomic, copy, readonly) NSDictionary *localInfoPlist; @property (nonatomic, copy, readonly) NSDictionary *romoteInfoPlist; diff --git a/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.m b/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.m index 5b8f9bf7..14f3445b 100644 --- a/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.m +++ b/WeChatPlugin/Sources/Config/TKWeChatPluginConfig.m @@ -220,6 +220,13 @@ - (NSMutableSet *)revokeMsgSet { return _revokeMsgSet; } +- (NSMutableSet *)unreadSessionSet { + if (!_unreadSessionSet) { + _unreadSessionSet = [NSMutableSet set]; + } + return _unreadSessionSet; +} + #pragma mark - 获取沙盒上的 plist 文件,包括:远程控制,自动回复,置底列表。 - (NSString *)remoteControlPlistFilePath { if (!_remoteControlPlistFilePath) { diff --git a/WeChatPlugin/Sources/Hook/MMChatsTableCellView+hook.m b/WeChatPlugin/Sources/Hook/MMChatsTableCellView+hook.m index 7766f880..6e849d9b 100644 --- a/WeChatPlugin/Sources/Hook/MMChatsTableCellView+hook.m +++ b/WeChatPlugin/Sources/Hook/MMChatsTableCellView+hook.m @@ -88,12 +88,15 @@ - (void)hook_menuWillOpen:(NSMenu *)arg1 { NSMenuItem *removeSessionItem = [[NSMenuItem alloc] initWithTitle:TKLocalizedString(@"assistant.chat.remove") action:@selector(contextMenuRemoveSession) keyEquivalent:@""]; + NSMenuItem *unreadSessionItem = [[NSMenuItem alloc] initWithTitle:TKLocalizedString(@"assistant.chat.unread") action:@selector(contextMenuUnreadSession) keyEquivalent:@""]; + [arg1 addItems:@[[NSMenuItem separatorItem], preventRevokeItem, multipleSelectionItem, clearUnReadItem, clearEmptySessionItem, - removeSessionItem + removeSessionItem, + unreadSessionItem ]]; [self hook_menuWillOpen:arg1]; } @@ -205,6 +208,18 @@ - (void)contextMenuRemoveSession { } } +- (void)contextMenuUnreadSession { + MMSessionInfo *sessionInfo = [(MMChatsTableCellView *)self sessionInfo]; + if (sessionInfo.m_uUnReadCount > 0) return; + + NSMutableSet *unreadSessionSet = [[TKWeChatPluginConfig sharedConfig] unreadSessionSet]; + if ([unreadSessionSet containsObject:sessionInfo.m_nsUserName]) return; + + [unreadSessionSet addObject:sessionInfo.m_nsUserName]; + MMSessionMgr *sessionMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")]; + [sessionMgr changeSessionUnreadCountWithUserName:sessionInfo.m_nsUserName to:sessionInfo.m_uUnReadCount + 1]; +} + - (void)hook_contextMenuSticky:(id)arg1 { [self hook_contextMenuSticky:arg1]; diff --git a/WeChatPlugin/Sources/Hook/WeChat+hook.m b/WeChatPlugin/Sources/Hook/WeChat+hook.m index ed5c713a..b4628310 100644 --- a/WeChatPlugin/Sources/Hook/WeChat+hook.m +++ b/WeChatPlugin/Sources/Hook/WeChat+hook.m @@ -60,6 +60,10 @@ + (void)hookWeChat { tk_hookMethod(objc_getClass("UserDefaultsService"), @selector(stringForKey:), [self class], @selector(hook_stringForKey:)); + // 设置标记未读 + tk_hookMethod(objc_getClass("MMChatMessageViewController"), @selector(onClickSession), [self class], @selector(hook_onClickSession)); + tk_hookMethod(objc_getClass("MMSessionMgr"), @selector(onUnReadCountChange:), [self class], @selector(hook_onUnReadCountChange:)); + // 替换沙盒路径 rebind_symbols((struct rebinding[2]) { { "NSSearchPathForDirectoriesInDomains", swizzled_NSSearchPathForDirectoriesInDomains, (void *)&original_NSSearchPathForDirectoriesInDomains }, @@ -412,6 +416,26 @@ + (BOOL)hook_preHandleWebUrlStr:(id)arg1 withMessage:(id)arg2 { } } +// 设置标记未读 +- (void)hook_onClickSession { + [self hook_onClickSession]; + MMChatMessageViewController *chatMessageVC = (MMChatMessageViewController *)self; + NSMutableSet *unreadSessionSet = [[TKWeChatPluginConfig sharedConfig] unreadSessionSet]; + if ([unreadSessionSet containsObject:chatMessageVC.chatContact.m_nsUsrName]) { + [unreadSessionSet removeObject:chatMessageVC.chatContact.m_nsUsrName]; + [[TKMessageManager shareManager] clearUnRead:chatMessageVC.chatContact.m_nsUsrName]; + } +} + +- (void)hook_onUnReadCountChange:(id)arg1 { + NSMutableSet *unreadSessionSet = [[TKWeChatPluginConfig sharedConfig] unreadSessionSet]; + if ([unreadSessionSet containsObject:arg1]) { + MMSessionMgr *sessionMgr = [[objc_getClass("MMServiceCenter") defaultCenter] getService:objc_getClass("MMSessionMgr")]; + MMSessionInfo *sessionInfo = [sessionMgr sessionInfoByUserName:arg1]; + sessionInfo.m_uUnReadCount++; + } + [self hook_onUnReadCountChange:arg1]; +} #pragma mark - hook 系统方法 - (void)hook_makeKeyAndOrderFront:(nullable id)sender { BOOL top = [[TKWeChatPluginConfig sharedConfig] onTop]; diff --git a/WeChatPlugin/WeChatPlugin.h b/WeChatPlugin/WeChatPlugin.h index d7099276..c8422e55 100644 --- a/WeChatPlugin/WeChatPlugin.h +++ b/WeChatPlugin/WeChatPlugin.h @@ -191,6 +191,7 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @property(nonatomic) BOOL m_isMentionedUnread; // @synthesize @property(retain, nonatomic) NSString *m_nsUserName; // @synthesize m_nsUserName; @property(retain, nonatomic) MMSessionInfoPackedInfo *m_packedInfo; +@property(nonatomic) unsigned int m_uUnReadCount; @end @protocol MMChatsTableCellViewDelegate @@ -210,11 +211,14 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @interface MMSessionMgr : NSObject @property(retain, nonatomic) NSMutableArray *m_arrSession; - (id)GetSessionAtIndex:(unsigned long long)arg1; +- (id)sessionInfoByUserName:(id)arg1; - (void)MuteSessionByUserName:(id)arg1; +- (void)onUnReadCountChange:(id)arg1; //- (void)TopSessionByUserName:(id)arg1; - (void)UnmuteSessionByUserName:(id)arg1; - (void)UntopSessionByUserName:(id)arg1; - (void)deleteSessionWithoutSyncToServerWithUserName:(id)arg1; +- (void)changeSessionUnreadCountWithUserName:(id)arg1 to:(unsigned int)arg2; - (void)removeSessionOfUser:(id)arg1 isDelMsg:(BOOL)arg2; - (void)sortSessions; - (void)FFDataSvrMgrSvrFavZZ; @@ -232,6 +236,8 @@ FOUNDATION_EXPORT const unsigned char WeChatPluginVersionString[]; @end @interface MMChatMessageViewController : NSViewController +@property(retain, nonatomic) WCContactData *chatContact; +- (void)onClickSession; @end @interface MMMessageTableItem : NSObject diff --git a/WeChatPlugin/en.lproj/Localizable.strings b/WeChatPlugin/en.lproj/Localizable.strings index 1c93951a..8538bb48 100644 --- a/WeChatPlugin/en.lproj/Localizable.strings +++ b/WeChatPlugin/en.lproj/Localizable.strings @@ -45,6 +45,7 @@ "assistant.chat.readAll" = "Mark All As Read"; "assistant.chat.clearEmpty" = "Clear All Empty Session"; "assistant.chat.remove" = "remove"; +"assistant.chat.unread" = "Unread"; // Remote Control "assistant.remoteControl.getList" = "Directive"; diff --git a/WeChatPlugin/zh-Hans.lproj/Localizable.strings b/WeChatPlugin/zh-Hans.lproj/Localizable.strings index daf05120..c7a35285 100644 --- a/WeChatPlugin/zh-Hans.lproj/Localizable.strings +++ b/WeChatPlugin/zh-Hans.lproj/Localizable.strings @@ -45,6 +45,7 @@ "assistant.chat.readAll" = "一键已读"; "assistant.chat.clearEmpty" = "清除空会话"; "assistant.chat.remove" = "移除"; +"assistant.chat.unread" = "标记未读"; // 远程控制相关 "assistant.remoteControl.getList" = "获取指令"; diff --git a/WeChatPlugin/zh-Hant.lproj/Localizable.strings b/WeChatPlugin/zh-Hant.lproj/Localizable.strings index 7685126a..7e811db2 100644 --- a/WeChatPlugin/zh-Hant.lproj/Localizable.strings +++ b/WeChatPlugin/zh-Hant.lproj/Localizable.strings @@ -45,6 +45,7 @@ "assistant.chat.readAll" = "一鍵已讀"; "assistant.chat.clearEmpty" = "清除空會話"; "assistant.chat.remove" = "移除"; +"assistant.chat.unread" = "标记未读"; // 遠程控制相關 "assistant.remoteControl.getList" = "獲取指令";