TUITypingStatusCellData.m 766 B

12345678910111213141516171819202122232425
  1. //
  2. // TUITypingStatusCellData.m
  3. // TUIChat
  4. //
  5. // Created by wyl on 2022/7/4.
  6. // Copyright © 2023 Tencent. All rights reserved.
  7. //
  8. #import "TUITypingStatusCellData.h"
  9. @implementation TUITypingStatusCellData
  10. + (TUIMessageCellData *)getCellData:(V2TIMMessage *)message {
  11. NSDictionary *param = [NSJSONSerialization JSONObjectWithData:message.customElem.data options:NSJSONReadingAllowFragments error:nil];
  12. TUITypingStatusCellData *cellData = [[TUITypingStatusCellData alloc] initWithDirection:message.isSelf ? MsgDirectionOutgoing : MsgDirectionIncoming];
  13. cellData.msgID = message.msgID;
  14. if ([param.allKeys containsObject:@"typingStatus"]) {
  15. cellData.typingStatus = [param[@"typingStatus"] intValue];
  16. }
  17. return cellData;
  18. }
  19. @end