TXLiveMessageDownSeatAll.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // TXLiveMessageDownSeatAll.m
  3. // StudentDaya
  4. //
  5. // Created by 王智 on 2023/2/28.
  6. // Copyright © 2023 DayaMusic. All rights reserved.
  7. //
  8. #import "TXLiveMessageDownSeatAll.h"
  9. @implementation TXLiveMessageDownSeatAll
  10. - (NSData *)encodeMessage {
  11. NSMutableDictionary *parm = [NSMutableDictionary dictionary];
  12. NSMutableDictionary *content = [NSMutableDictionary dictionary];
  13. [content setValue:[self.userInfo getUserInfoDic] forKey:@"sendUserInfo"];
  14. [parm setValue:content forKey:@"content"];
  15. [parm setValue:self.objectName forKey:@"objectName"];
  16. return [NSJSONSerialization dataWithJSONObject:parm options:kNilOptions error:nil];
  17. }
  18. - (NSDictionary *)decodeData:(NSData *)data {
  19. if (data == nil) return nil;
  20. NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
  21. NSDictionary *json = [[NSDictionary alloc] initWithDictionary:dictionary];
  22. if (json == nil) return nil;
  23. return json;
  24. }
  25. - (void)evaluateSource:(NSDictionary *)msgDic {
  26. NSDictionary *content = [msgDic ks_dictionaryValueForKey:@"content"];
  27. self.userInfo = [TXLiveUser evaluateUserInfo:[content ks_dictionaryValueForKey:@"sendUserInfo"]];
  28. }
  29. + (NSString *)getObjectName {
  30. return @"RC:Chatroom:DownSeatAll";
  31. }
  32. - (NSString *)objectName {
  33. return @"RC:Chatroom:DownSeatAll";
  34. }
  35. @end