公屏消息、资料卡增加贵族icon

This commit is contained in:
chenguilong
2022-01-13 15:47:36 +08:00
committed by fengshuo
parent e06ac0b3dd
commit 384e318cda
4 changed files with 58 additions and 12 deletions

View File

@@ -94,15 +94,22 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
///
[attribute appendAttributedString:[self createOfficalAndNewuserAttribute:model.defUser newUser:model.newUser]];
if (model.vipIcon) {//icon
[attribute appendAttributedString:[self createUrlImageAttribute:model.vipIcon]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (model.experUrl) {
[attribute appendAttributedString:[self createUrlImageAttribute:model.experUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) {
if (model.inRoomNameplatePic.length > 0 && model.inRoomNameplateWord.length > 0) { //
[attribute appendAttributedString:[self createNameplateAttibute:model.inRoomNameplateWord image:model.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
} else if (model.inRoomNameplatePic.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:model.inRoomNameplatePic]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
[attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
[attribute appendAttributedString:[self createTextAttribute:message.text color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
@@ -130,6 +137,14 @@
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
NSDictionary * dic = [(NSDictionary *)messageExt.roomExt.toJSONObject objectForKey:message.from];
XPMessageRemoteExtModel * extModel = [XPMessageRemoteExtModel modelWithDictionary:dic];
if (extModel.vipIcon.length > 0) {//icon
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.vipIcon]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.experUrl.length > 0) {//
[attribute appendAttributedString:[self createUrlImageAttribute:extModel.experUrl]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
if (extModel.inRoomNameplatePic.length > 0 && extModel.inRoomNameplateWord.length > 0) {
[attribute appendAttributedString:[self createNameplateAttibute:extModel.inRoomNameplateWord image:extModel.inRoomNameplatePic textFont:[UIFont systemFontOfSize:9]]];
[attribute appendAttributedString:[self createSapceAttribute:2]];