超级礼物

This commit is contained in:
liyuhua
2024-03-25 14:39:36 +08:00
parent 6f75c535c1
commit 17346ffedf
34 changed files with 270 additions and 589 deletions

View File

@@ -114,7 +114,6 @@
XPMessageRemoteExtModel * model = [XPMessageRemoteExtModel modelWithJSON:message.remoteExt[message.from]];
messageInfo.bubbleImageUrl = [self parseMessageBubble:message];
int first = attachment.first;
int second = attachment.second;
if (first == CustomMessageType_Gift) {///
return [self createSendGiftAttribute:attachment sendInfo:model messageInfo:messageInfo];
} else if(first == CustomMessageType_AllMicroSend) {///
@@ -183,7 +182,10 @@
return [self createGuardianPlanetAttribute:attachment messageInfo:messageInfo];
}else if(first == CustomMessageType_General_Public_Screen){
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
}else if(first == CustomMessageType_Super_Gift){
return [self createGeneralPublicScreenAttribute:attachment messageInfo:messageInfo];
}
return nil;
}
@@ -479,7 +481,9 @@
if(subTextDic.allKeys.count > 0){
NSString *subText = subTextDic[@"zh-CHT"] == nil ? subTextDic[subTextDic.allKeys.firstObject] : subTextDic[@"zh-CHT"];
NSAttributedString *attText = [[NSAttributedString alloc]initWithString:subText attributes:@{NSForegroundColorAttributeName:[DJDKMIMOMColor colorWithHexString:model.textColor]}];
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attText];
}
@kWeakify(self)
[attribute yy_setTextHighlightRange:[attribute.string rangeOfString:subText] color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@@ -494,7 +498,10 @@
}else if ([model.type isEqualToString:@"IMAGE"]){
NSMutableAttributedString *attImage = [self createUrlImageAttribute:model.image size:CGSizeMake(model.width, model.height)];
[attImage appendAttributedString:[self createSapceAttribute:2]];
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage];
if ([attribute.string containsString:[NSString stringWithFormat:@"{%@}",model.key]]){
[attribute replaceCharactersInRange:[attribute.string rangeOfString:[NSString stringWithFormat:@"{%@}",model.key]] withAttributedString:attImage];
}
}
}
messageInfo.content = attribute;
@@ -1042,6 +1049,8 @@
if (giftInfo == nil) {
giftInfo = [[XPGiftStorage shareStorage] findGiftInfo:info.giftId];
}
///
[attribute appendAttributedString:[self createOfficalAndNewuserAttribute:sendInfo.defUser newUser:sendInfo.newUser fromSayHelloChannel:sendInfo.fromSayHelloChannel]];
//nick