修改完成
This commit is contained in:
@@ -271,7 +271,20 @@ static Class<TUIMessageDataProviderDataSource> gDataSourceClass = nil;
|
||||
|
||||
+ (TUIMessageCellData *)getUnsupportedCellData:(V2TIMMessage *)message {
|
||||
TUITextMessageCellData *cellData = [[TUITextMessageCellData alloc] initWithDirection:(message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming)];
|
||||
cellData.content = TIMCommonLocalizableString(TUIKitNotSupportThisMessage);
|
||||
if ([message.userID isEqualToString:@"@RBT#u88"]) {
|
||||
V2TIMCustomElem *el = message.customElem;
|
||||
NSError *error = nil;
|
||||
// 将 JSON 数据转换为字典
|
||||
NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:el.data options:kNilOptions error:&error];
|
||||
NSArray *arr = dictionary[@"chunks"];
|
||||
NSString*str = @"";
|
||||
for (NSString*s in arr) {
|
||||
str = [str stringByAppendingFormat:@"%@",s];
|
||||
}
|
||||
cellData.content = str;
|
||||
}else{
|
||||
cellData.content = TIMCommonLocalizableString(TUIKitNotSupportThisMessage);
|
||||
}
|
||||
cellData.reuseId = TTextMessageCell_ReuseId;
|
||||
return cellData;
|
||||
}
|
||||
|
||||
@@ -645,19 +645,20 @@
|
||||
switch (type) {
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeInsert:
|
||||
[self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeDelete:
|
||||
[self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
case TUIMessageBaseDataProviderDataSourceChangeTypeReload:
|
||||
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:index inSection:0] ]
|
||||
withRowAnimation:animation ? UITableViewRowAnimationFade : UITableViewRowAnimationNone];
|
||||
withRowAnimation:UITableViewRowAnimationNone];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)dataProviderDataSourceDidChange:(TUIMessageDataProvider *)dataProvider {
|
||||
|
||||
Reference in New Issue
Block a user