WFCCGroupInfo.m 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // WFCCGroupInfo.m
  3. // WFChatClient
  4. //
  5. // Created by heavyrain on 2017/8/16.
  6. // Copyright © 2017年 WildFireChat. All rights reserved.
  7. //
  8. #import "WFCCGroupInfo.h"
  9. @implementation WFCCGroupInfo
  10. - (NSString *)displayName {
  11. return self.remark.length?self.remark:self.name;
  12. }
  13. - (id)toJsonObj {
  14. NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
  15. dict[@"target"] = self.target;
  16. dict[@"type"] = @(self.type);
  17. if(self.name.length)
  18. dict[@"name"] = self.name;
  19. if(self.portrait.length)
  20. dict[@"portrait"] = self.portrait;
  21. dict[@"memberCount"] = @(self.memberCount);
  22. if(self.owner.length)
  23. dict[@"owner"] = self.owner;
  24. if(self.extra.length)
  25. dict[@"extra"] = self.extra;
  26. if(self.remark.length)
  27. dict[@"remark"] = self.remark;
  28. dict[@"mute"] = @(self.mute);
  29. dict[@"joinType"] = @(self.joinType);
  30. dict[@"privateChat"] = @(self.privateChat);
  31. dict[@"searchable"] = @(self.searchable);
  32. dict[@"historyMessage"] = @(self.historyMessage);
  33. dict[@"maxMemberCount"] = @(self.maxMemberCount);
  34. dict[@"superGroup"] = @(self.superGroup);
  35. dict[@"deleted"] = @(self.deleted);
  36. [self setDict:dict key:@"updateDt" longlongValue:self.updateDt];
  37. [self setDict:dict key:@"memberDt" longlongValue:self.memberDt];
  38. return dict;
  39. }
  40. @end