YOUPAIZhaPianTextAttachment.m 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // YOUPAIZhaPianTextAttachment.m
  3. // YOUQU
  4. //
  5. // Created by xiaohaoran on 2021/12/13.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIZhaPianTextAttachment.h"
  9. @implementation YOUPAIZhaPianTextAttachment
  10. - (NSString *)encodeAttachment
  11. {
  12. NSDictionary *dict = @{
  13. CMType : @(CustomOnChatRoomFP),
  14. CMData : @{
  15. }
  16. };
  17. NSData *data = [NSJSONSerialization dataWithJSONObject:dict
  18. options:0
  19. error:nil];
  20. NSString *content = nil;
  21. if (data) {
  22. content = [[NSString alloc] initWithData:data
  23. encoding:NSUTF8StringEncoding];
  24. }
  25. return content;
  26. }
  27. - (NSString *)cellContent:(NIMMessage *)message{
  28. return @"YOUPAIZhaPianTextContentView";
  29. }
  30. - (CGSize)contentSize:(NIMMessageModel *)model cellWidth:(CGFloat)width{
  31. CGFloat topTitleHeight =[@"贸然留外部联系方式可能有安全风险. 恶意留外部联系方式、引流,账号将会封禁, 请勿转账、谨防诈骗" heightWithFont:[UIFont systemFontOfSize:12] padding:3.0 constrainedToWidth:KScreenWidth-50.0f];
  32. CGFloat currentY = topTitleHeight+5.0f;
  33. return CGSizeMake(KScreenWidth, currentY);
  34. }
  35. - (UIEdgeInsets)contentViewInsets:(NIMMessage *)message
  36. {
  37. return UIEdgeInsetsZero;
  38. }
  39. @end