排麦模式

This commit is contained in:
fengshuo
2021-12-20 21:17:12 +08:00
parent c4b58a33c4
commit 99c65e7959
6 changed files with 219 additions and 8 deletions

View File

@@ -68,6 +68,8 @@
return [self createKickUserAttribute:attachment info:kickModel];
} else if(first == CustomMessageType_Candy_Tree ) {//
return [self createCandyTreeHighLevelAttribute:attachment];
} else if(first == CustomMessageType_Arrange_Mic) {
return [self createArrangeMicAttribute:attachment];
}
return nil;
}
@@ -149,6 +151,30 @@
return nil;
}
#pragma mark -
- (NSAttributedString *)createArrangeMicAttribute:(AttachmentModel *)attachment {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
[attribute appendAttributedString:[self createTextAttribute:@"管理员" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
if (attachment.second == Custom_Message_Sub_Arrange_Mic_Mode_Open) {
[attribute appendAttributedString:[self createTextAttribute:@"开启了" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"排麦模式" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
} else if (attachment.second == Custom_Message_Sub_Arrange_Mic_Mode_Close) {
[attribute appendAttributedString:[self createTextAttribute:@"关闭了" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"排麦模式" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
} else if (attachment.second == Custom_Message_Sub_Arrange_Mic_Free_Mic_Open) {
NSDictionary * dic = attachment.data;
[attribute appendAttributedString:[self createTextAttribute:@"设置" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%d麦", ((NSNumber *)dic[@"micPos"]).intValue + 1 ] color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"为自由麦" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
} else if (attachment.second == Custom_Message_Sub_Arrange_Mic_Free_Mic_Close) {
NSDictionary * dic = attachment.data;
[attribute appendAttributedString:[self createTextAttribute:@"关闭了" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%d麦", ((NSNumber *)dic[@"micPos"]).intValue + 1 ] color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:@"自由麦" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
}
return attribute;
}
#pragma mark -
- (NSAttributedString *)createCandyTreeHighLevelAttribute:(AttachmentModel *)attachment {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];