WFCCTipNotificationMessageContent.m 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // WFCCNotificationMessageContent.m
  3. // WFChatClient
  4. //
  5. // Created by heavyrain on 2017/9/19.
  6. // Copyright © 2017年 WildFireChat. All rights reserved.
  7. //
  8. #import "WFCCTipNotificationMessageContent.h"
  9. #import "WFCCIMService.h"
  10. #import "WFCCNetworkService.h"
  11. #import "Common.h"
  12. @implementation WFCCTipNotificationContent
  13. - (WFCCMessagePayload *)encode {
  14. WFCCMessagePayload *payload = [super encode];
  15. payload.contentType = [self.class getContentType];
  16. payload.content = self.tip;
  17. return payload;
  18. }
  19. - (void)decode:(WFCCMessagePayload *)payload {
  20. [super decode:payload];
  21. self.tip = payload.content;
  22. }
  23. + (int)getContentType {
  24. return MESSAGE_CONTENT_TYPE_TIP;
  25. }
  26. + (int)getContentFlags {
  27. return WFCCPersistFlag_PERSIST;
  28. }
  29. + (void)load {
  30. [[WFCCIMService sharedWFCIMService] registerMessageContent:self];
  31. }
  32. - (NSString *)formatNotification:(WFCCMessage *)message {
  33. return self.tip;
  34. }
  35. - (NSString *)digest:(WFCCMessage *)message {
  36. return self.tip;
  37. }
  38. @end