驾驶座驾进房

This commit is contained in:
fengshuo
2021-12-16 20:22:01 +08:00
parent 286d617fba
commit 5c1e4ed381
11 changed files with 216 additions and 46 deletions

View File

@@ -23,6 +23,7 @@
#import "UserInfoModel.h"
#import "MicroStateModel.h"
#import "RoomInfoModel.h"
#import "XPUserEnterRoomExtModel.h"
#import "NetImageView.h"
@@ -105,12 +106,20 @@
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
NIMChatroomNotificationMember *member = content.targets[0];
NIMMessageChatroomExtension * messageExt = (NIMMessageChatroomExtension *)message.messageExt;
switch (content.eventType) {
case NIMChatroomEventTypeEnter:///
{
NSString* nick = member.nick.length > 0 ? member.nick : @"";
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
NSDictionary * dic = [(NSDictionary *)messageExt.roomExt.toJSONObject objectForKey:message.from];
XPUserEnterRoomExtModel * extModel = [XPUserEnterRoomExtModel modelWithDictionary:dic];;
[attribute appendAttributedString:[self createTextAttribute:nick color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
if (extModel.carName.length > 0) {
[attribute appendAttributedString:[self createTextAttribute:@" 驾着 " color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createTextAttribute:extModel.carName color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
[attribute appendAttributedString:[self createSapceAttribute:2]];
}
[attribute appendAttributedString:[self createTextAttribute:@"进入了房间" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
[self attributeAddHihtLight:attribute uid:message.from.integerValue];
return attribute;