WFCCTipNotificationMessageContent.m 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 = [[WFCCMessagePayload alloc] init];
  15. payload.contentType = [self.class getContentType];
  16. payload.content = self.tip;
  17. return payload;
  18. }
  19. - (void)decode:(WFCCMessagePayload *)payload {
  20. self.tip = payload.content;
  21. }
  22. + (int)getContentType {
  23. return MESSAGE_CONTENT_TYPE_TIP;
  24. }
  25. + (int)getContentFlags {
  26. return WFCCPersistFlag_PERSIST;
  27. }
  28. + (void)load {
  29. [[WFCCIMService sharedWFCIMService] registerMessageContent:self];
  30. }
  31. - (NSString *)formatNotification {
  32. return self.tip;
  33. }
  34. - (NSString *)digest {
  35. return self.tip;
  36. }
  37. @end