塔罗公屏消息

This commit is contained in:
chenguilong
2022-03-23 11:25:53 +08:00
committed by fengshuo
parent 98cbf42388
commit 5557f7a769
2 changed files with 26 additions and 1 deletions

View File

@@ -86,7 +86,9 @@
return [self createNobleLevelAttribute:attachment];
} else if (first == CustomMessageType_Face) {//
return [self createRoomFaceAttribute:attachment];
}
} else if (first == CustomMessageType_Tarot) {//
return [self createTarotAttribute:attachment];
}
return nil;
}
@@ -385,6 +387,22 @@
return attribute;
}
#pragma mark -
- (NSAttributedString *)createTarotAttribute:(AttachmentModel *)attachment {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
if (attachment.second == Custom_Message_Sub_Tarot) {
[attribute appendAttributedString:[self createTextAttribute:@"恭喜" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:attachment.data[@"nick"] color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
NSString *text = [NSString stringWithFormat:@" %@", attachment.data[@"drawMsgText"]];
[attribute appendAttributedString:[self createTextAttribute:text color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
if ([attachment.data[@"drawGoldNum"] intValue] > 1) {
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%d",[attachment.data[@"drawGoldNum"] intValue]] color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
}
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ ", attachment.data[@"chargeProdName"]] color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
}
return attribute;
}
#pragma mark - //
- (NSAttributedString *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];