#pragma mark - 微信群艾特所有人 -
CHMethod(2, void, CMessageMgr, AddMsg, id, arg1, MsgWrap, id, arg2) {
CMessageWrap *wrap = (CMessageWrap *)arg2;
int type = wrap.m_uiMessageType;
NSString *knFromUser = wrap.m_nsFromUsr;
NSString *knToUsr = wrap.m_nsToUsr;
NSString *knContent = wrap.m_nsContent;
NSString *knSource = wrap.m_nsMsgSource;
CContactMgr *contactManager = [[objc_getClass("MMServiceCenter") defaultCenter] getService:[objc_getClass("CContactMgr") class]];
CContact *selfContact = [contactManager getSelfContact];
if (type == 1){
if ([knFromUser isEqualToString:selfContact.m_nsUsrName]) {
if ([knToUsr hasSuffix:@"@chatroom"]) {
if( knSource == nil){
NSArray *result = (NSArray *)objc_msgSend(objc_getClass("CContact"), @selector(getChatRoomMemberWithoutMyself:),knToUsr);
BOOL isOn = [[[WXSettingsInstance allSettings] objectForKey:kUserDefaultCallAll] boolValue];
if ([knContent hasPrefix:@"#所有人"]){
NSString *subStr = [knContent substringFromIndex:4];
NSMutableString *string = [NSMutableString string];
[result enumerateObjectsUsingBlock:^(CContact *obj, NSUInteger idx, BOOL * _Nonnull stop) {
[string appendFormat:@",%@",obj.m_nsUsrName];
}];
NSString *sourceString = [string substringFromIndex:1];
wrap.m_uiStatus = 3;
wrap.m_nsContent = subStr;
wrap.m_nsMsgSource = [NSString stringWithFormat:@"<msgsource><atuserlist>%@</atuserlist></msgsource>",sourceString];
} else if (isOn) {
NSMutableString *string = [NSMutableString string];
[result enumerateObjectsUsingBlock:^(CContact *obj, NSUInteger idx, BOOL * _Nonnull stop) {
[string appendFormat:@",%@",obj.m_nsUsrName];
}];
NSString *sourceString = [string substringFromIndex:1];
wrap.m_uiStatus = 3;
wrap.m_nsContent = knContent;
wrap.m_nsMsgSource = [NSString stringWithFormat:@"<msgsource><atuserlist>%@</atuserlist></msgsource>",sourceString];
}
}
}
}
}
CHSuper(2, CMessageMgr, AddMsg, arg1, MsgWrap, wrap);
}
微信群艾特所有人
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 研究了一段时间反编译逆向工程,只是略微了解了一些皮毛,最近忙的事情太杂,就简单写一下吧。在文章开始之前,首先感谢"...