加入、退出粉丝团接口及协议处理
This commit is contained in:
@@ -93,6 +93,8 @@
|
||||
return [self createRoomFaceAttribute:attachment];
|
||||
} else if (first == CustomMessageType_Tarot) {//塔罗
|
||||
return [self createTarotAttribute:attachment];
|
||||
} else if (first == CustomMessageType_Anchor_FansTeam) {//粉丝团
|
||||
return [self createAnchorFansTeamAttribute:attachment];
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
@@ -408,6 +410,36 @@
|
||||
return attribute;
|
||||
}
|
||||
|
||||
#pragma mark - 个播粉丝团
|
||||
- (NSAttributedString *)createAnchorFansTeamAttribute:(AttachmentModel *)attachment {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
NSInteger uid = 0;
|
||||
if ([attachment.data[@"uid"] isKindOfClass:[NSNumber class]]) {
|
||||
uid = ((NSNumber *)attachment.data[@"uid"]).integerValue;
|
||||
} else if ([attachment.data[@"uid"] isKindOfClass:[NSString class]]) {
|
||||
uid = ((NSString *)attachment.data[@"uid"]).integerValue;
|
||||
}
|
||||
NSString *idString = [NSString stringWithFormat:@"%ld", uid];
|
||||
NSString *nickName = attachment.data[@"nickName"];
|
||||
if ([idString isEqualToString:[[AccountInfoStorage instance] getUid]]) {
|
||||
nickName = @"您";
|
||||
}
|
||||
if (attachment.second == Custom_Message_Sub_FansTeam_Open_Success) {/// 开通粉丝团成功
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"恭喜" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:nickName color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"开通粉丝团成功" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
} else if (attachment.second == Custom_Message_Sub_FansTeam_Join_Success) {///加入粉丝团
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"恭喜" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:nickName color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"加入粉丝团" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
} else if (attachment.second == Custom_Message_Sub_FansTeam_Out_Success) {//退出粉丝团
|
||||
[attribute appendAttributedString:[self createTextAttribute:nickName color:[ThemeColor messageNickColor] font:kRoomMessageDefalutFont]];
|
||||
[attribute appendAttributedString:[self createTextAttribute:@"已退出粉丝团" color:[ThemeColor messageDefaultTextColor] font:kRoomMessageDefalutFont]];
|
||||
}
|
||||
[self attributeAddHihtLight:attribute uid:uid];
|
||||
return attribute;
|
||||
}
|
||||
|
||||
#pragma mark - 踢出房间/拉黑/下麦
|
||||
- (NSAttributedString *)createKickUserAttribute:(AttachmentModel *)attachment info:(XPKickUserModel *)info {
|
||||
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
|
||||
|
Reference in New Issue
Block a user