糖果树公屏显示
This commit is contained in:
@@ -64,6 +64,8 @@
|
||||
} else if(first == CustomMessageType_Kick_User || first == CustomMessageType_Queue) {
|
||||
XPKickUserModel * kickModel = [XPKickUserModel modelWithJSON:attachment.data];
|
||||
return [self createKickUserAttribute:attachment info:kickModel];
|
||||
} else if(first == CustomMessageType_Candy_Tree ) {//糖果树
|
||||
return [self createCandyTreeHighLevelAttribute:attachment];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@@ -126,6 +128,22 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
#pragma mark - 糖果树公屏消息
|
||||
- (NSAttributedString *)createCandyTreeHighLevelAttribute:(AttachmentModel *)attachment {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
//action
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"厉害了 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
NSInteger uid = 0;
|
||||
if ([attachment.data[@"uid"] isKindOfClass:[NSNumber class]]) {
|
||||
uid = ((NSNumber *)attachment.data[@"uid"]).integerValue;
|
||||
} else if ([attachment.data[@"uid"] isKindOfClass:[NSString class]]) {
|
||||
uid = ((NSString *)attachment.data[@"uid"]).integerValue;
|
||||
}
|
||||
[attribute appendAttributedString:[self createNickAtrribute:attachment.data[@"nick"] uid:uid]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"摘下糖果获得" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"prizeName"] color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||
return attribute;
|
||||
}
|
||||
#pragma mark - 踢出房间/拉黑/下麦
|
||||
- (NSAttributedString *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
|
Reference in New Issue
Block a user