WFCCFriendAddedMessageContent.m 1020 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // WFCCFriendAddedMessageContent.m
  3. // WFChatClient
  4. //
  5. // Created by heavyrain on 2017/9/19.
  6. // Copyright © 2017年 WildFireChat. All rights reserved.
  7. //
  8. #import "WFCCFriendAddedMessageContent.h"
  9. #import "WFCCIMService.h"
  10. #import "WFCCNetworkService.h"
  11. #import "Common.h"
  12. @implementation WFCCFriendAddedMessageContent
  13. - (WFCCMessagePayload *)encode {
  14. WFCCMessagePayload *payload = [super encode];
  15. payload.contentType = [self.class getContentType];
  16. return payload;
  17. }
  18. - (void)decode:(WFCCMessagePayload *)payload {
  19. [super decode:payload];
  20. }
  21. + (int)getContentType {
  22. return MESSAGE_FRIEND_ADDED_NOTIFICATION;
  23. }
  24. + (int)getContentFlags {
  25. return WFCCPersistFlag_PERSIST;
  26. }
  27. + (void)load {
  28. [[WFCCIMService sharedWFCIMService] registerMessageContent:self];
  29. }
  30. - (NSString *)formatNotification:(WFCCMessage *)message {
  31. return @"你们已经是好友了,可以开始聊天了。";
  32. }
  33. - (NSString *)digest:(WFCCMessage *)message {
  34. return [self formatNotification:message];
  35. }
  36. @end