Răsfoiți Sursa

[*] 暂时提交 - 修复消息判断问题

yanxuyao 10 luni în urmă
părinte
comite
cc7df01328

+ 2 - 0
MiMoLive/TUIKit/TUIChat/BaseCellData/Custom/MOSystemNormalCellData.h

@@ -20,6 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 - (CGSize)contentSize;
 
++ (id)objectOrNilForKey:(id)aKey fromDictionary:(NSDictionary *)dict;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 9 - 3
MiMoLive/TUIKit/TUIChat/UI_Classic/Chat/TUIBaseMessageController.m

@@ -685,9 +685,15 @@
     }
     
     if(msg.elemType == V2TIM_ELEM_TYPE_CUSTOM){
-        TUIMessageCellData *cellData = [MOSystemNormalCellData getCellData:msg];
-        if(cellData){
-            return cellData;
+        NSDictionary *param = [NSJSONSerialization JSONObjectWithData:msg.customElem.data options:NSJSONReadingAllowFragments error:nil];
+        if (param) {
+            NSInteger type = [[MOSystemNormalCellData objectOrNilForKey:@"type" fromDictionary:param] integerValue];
+            if(type > 0){
+                TUIMessageCellData *cellData = [MOSystemNormalCellData getCellData:msg];
+                if(cellData){
+                    return cellData;
+                }
+            }
         }
     }