39 lines
1.1 KiB
Objective-C
39 lines
1.1 KiB
Objective-C
//
|
|
// MessageGameOrderModel.m
|
|
// YuMi
|
|
//
|
|
// Created by P on 2024/7/10.
|
|
//
|
|
|
|
#import "MessageGameOrderModel.h"
|
|
#import "AttachmentModel.h"
|
|
|
|
@implementation MessageGameOrderModel
|
|
|
|
- (instancetype)initWithMessage:(NIMMessage *)message {
|
|
if (self = [super init]) {
|
|
self.message = message;
|
|
self.isHiddenAvatar = NO;
|
|
self.messageType = SessionMessageType_Custom;
|
|
|
|
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
|
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
|
|
NSDictionary *gameInfos = (NSDictionary *)attachment.data;
|
|
|
|
self.title = [gameInfos objectForKey:@"gameName"];
|
|
self.round = [[gameInfos objectForKey:@"inning"] integerValue];
|
|
self.bgURLPath = [gameInfos objectForKey:@"gamePic"];
|
|
self.logoURLPath = [gameInfos objectForKey:@"gameLogo"];
|
|
|
|
self.contentSize = CGSizeMake(234 + MESSAGE_PADDING* 2, 98 + MESSAGE_PADDING * 2);
|
|
self.height = 98 + MESSAGE_PADDING * 2 + CONTENT_PADDING_V_TOTAL;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSString *)cellContent:(MessageBaseModel *)model {
|
|
return @"MessageGameOrderView";
|
|
}
|
|
|
|
@end
|