Fix Group Chat Message Data Parse

This commit is contained in:
Jeason Lee 2020-01-15 16:12:28 +08:00
parent c6e0daafb6
commit 02c0c1a1f5
2 changed files with 4 additions and 4 deletions

View File

@ -333,12 +333,12 @@ static void __attribute__((constructor)) tweak(void) {
MMMessageCellView *cell = (MMMessageCellView *)self; MMMessageCellView *cell = (MMMessageCellView *)self;
MessageData *messageData = cell.messageTableItem.message; MessageData *messageData = cell.messageTableItem.message;
NSString *content = messageData.msgContent; NSString *content = messageData.msgContent;
NSDictionary *dictionary = [NSDictionary dictionaryWithXMLString:content]; NSString *emoji = [[content tweak_subStringFrom:@"<msg>" to:@"</msg>"] stringByTrimmingCharactersInSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSDictionary *emojiDictionary = dictionary[@"emoji"]; NSDictionary *dictionary = [NSDictionary dictionaryWithXMLString:emoji];
if (![emojiDictionary objectForKey:@"_md5"]) { if (![dictionary objectForKey:@"_md5"]) {
return; return;
} }
NSString *stickerMD5 = emojiDictionary[@"_md5"]; NSString *stickerMD5 = dictionary[@"_md5"];
if (!stickerMD5.length) { if (!stickerMD5.length) {
return; return;
} }