修改欢迎Ta
This commit is contained in:
@@ -130,6 +130,8 @@
|
|||||||
return [self createWishGiftAttribute:attachment messageInfo:messageInfo];
|
return [self createWishGiftAttribute:attachment messageInfo:messageInfo];
|
||||||
} else if (first == CustomMessageType_Starred_Kitchen) {
|
} else if (first == CustomMessageType_Starred_Kitchen) {
|
||||||
return [self createStarredKitchenAttribute:attachment messageInfo:messageInfo];
|
return [self createStarredKitchenAttribute:attachment messageInfo:messageInfo];
|
||||||
|
} else if (first == CustomMessageType_Room_Welcome && attachment.second == Custom_Message_Sub_Room_Welcome) {
|
||||||
|
return [self createWelcomeAttribute:attachment messageInfo:messageInfo];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
@@ -294,14 +296,13 @@
|
|||||||
if (code == 200) {
|
if (code == 200) {
|
||||||
NSDictionary *dataDcit = data.data;
|
NSDictionary *dataDcit = data.data;
|
||||||
NSString *msg = dataDcit[@"msg"];
|
NSString *msg = dataDcit[@"msg"];
|
||||||
if (msg.length > 0) {
|
|
||||||
/// 发动欢迎消息
|
/// 发动欢迎消息
|
||||||
AttachmentModel * attachment = [[AttachmentModel alloc] init];
|
AttachmentModel * attachment = [[AttachmentModel alloc] init];
|
||||||
attachment.first = CustomMessageType_Room_Welcome;
|
attachment.first = CustomMessageType_Room_Welcome;
|
||||||
attachment.second = Custom_Message_Sub_Room_Welcome;
|
attachment.second = Custom_Message_Sub_Room_Welcome;
|
||||||
NSDictionary * dic = @{@"targetUid": toUid,
|
NSDictionary * dic = @{@"targetUid": toUid,
|
||||||
@"targetNick": nick,
|
@"targetNick": nick,
|
||||||
@"content":msg,
|
@"content":msg ? msg : @"",
|
||||||
@"isFans":dataDcit[@"isFans"]
|
@"isFans":dataDcit[@"isFans"]
|
||||||
};
|
};
|
||||||
attachment.data = dic;
|
attachment.data = dic;
|
||||||
@@ -318,7 +319,6 @@
|
|||||||
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) {
|
[[NIMSDK sharedSDK].chatManager sendMessage:message toSession:session completion:^(NSError * _Nullable error) {
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} uid:uid toUid:toUid];
|
} uid:uid toUid:toUid];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@@ -399,6 +399,17 @@
|
|||||||
return messageInfo;
|
return messageInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma mark - 欢迎Ta
|
||||||
|
- (XPMessageInfoModel *)createWelcomeAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{
|
||||||
|
NSString *nickName = attachment.data[@"targetNick"];
|
||||||
|
NSString *uid = attachment.data[@"targetUid"];
|
||||||
|
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||||
|
[attribute appendAttributedString:[self createTextAttribute:@"欢迎" color:[ThemeColor messageTextColor] font:kRoomMessageDefalutFont]];
|
||||||
|
[attribute appendAttributedString:[self createNickAtrribute:nickName ? nickName : @"" uid:uid.integerValue]];
|
||||||
|
messageInfo.content = attribute;
|
||||||
|
return messageInfo;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - 红包
|
#pragma mark - 红包
|
||||||
- (XPMessageInfoModel *)createRedPacketAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{
|
- (XPMessageInfoModel *)createRedPacketAttribute:(AttachmentModel *)attachment messageInfo:(XPMessageInfoModel *)messageInfo{
|
||||||
XPOpenRedPacketModel *info = [XPOpenRedPacketModel modelWithDictionary:attachment.data];
|
XPOpenRedPacketModel *info = [XPOpenRedPacketModel modelWithDictionary:attachment.data];
|
||||||
|
@@ -483,6 +483,8 @@ NSString * const kRoomShowTopicKey = @"kRoomShowTopicKey";
|
|||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
return;
|
return;
|
||||||
|
} else if(attachment.first == CustomMessageType_Room_Welcome && attachment.second == Custom_Message_Sub_Room_Welcome) {
|
||||||
|
// [self addRoomMessage:message];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (self.hostDelegate.getRoomInfo.isCloseScreen) {
|
if (self.hostDelegate.getRoomInfo.isCloseScreen) {
|
||||||
|
Reference in New Issue
Block a user