Commit 5be2c6d4d3e40445f3d2ed9ae12a1a1f01f1ad96
1 parent
3a27b875
接受礼物的展示逻辑,不接受历史消息
Showing
3 changed files
with
17 additions
and
1 deletions
LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftViews/GiftListView.h
LiveVideoCloud/Classes/Sections/InteractionSections/Gift/GiftViews/GiftListView.m
| ... | ... | @@ -205,6 +205,18 @@ |
| 205 | 205 | return giftName; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | +- (NSInteger)recGiftIndexFromGiftName:(NSString *)giftName | |
| 209 | +{ | |
| 210 | + NSInteger index = 0; | |
| 211 | + for (NSString *str in _giftNames) { | |
| 212 | + if ([str isEqualToString:giftName]) { | |
| 213 | + index = [_giftNames indexOfObject:str]; | |
| 214 | + NSLog(@"rec index %zd,name %@",index,str); | |
| 215 | + } | |
| 216 | + } | |
| 217 | + return index; | |
| 218 | +} | |
| 219 | + | |
| 208 | 220 | #pragma mark - getter |
| 209 | 221 | |
| 210 | 222 | - (NSArray *)giftArray | ... | ... |
LiveVideoCloud/Classes/Sections/InteractionSections/LiveBaseView.m
| ... | ... | @@ -101,7 +101,7 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 101 | 101 | { |
| 102 | 102 | _roomId = roomId; |
| 103 | 103 | [CNLiveChatManager sharedCNLiveChatManager].delegate = self; |
| 104 | - [[CNLiveChatManager sharedCNLiveChatManager] joinChatRoom:roomId messageCount:10 success:^(NSString *targetId) { | |
| 104 | + [[CNLiveChatManager sharedCNLiveChatManager] joinChatRoom:roomId messageCount:0 success:^(NSString *targetId) { | |
| 105 | 105 | NSLog(@"连接聊天室成功success %@",targetId); |
| 106 | 106 | } error:^(CNLiveChatErrorCode errors, NSString *targetId) { |
| 107 | 107 | NSLog(@"error"); |
| ... | ... | @@ -533,7 +533,9 @@ typedef NS_ENUM(NSInteger, PopType) {//弹窗类型 |
| 533 | 533 | giftModel.sender = message.userInfo.name; |
| 534 | 534 | giftModel.giftName = [msgDic objectForKey:msgGiftName]; |
| 535 | 535 | giftModel.icon = message.userInfo.portraitUri; |
| 536 | + giftModel.giftStyle = GiftStyleCombo; | |
| 536 | 537 | |
| 538 | + giftModel.index = [self.giftListView recGiftIndexFromGiftName:[msgDic objectForKey:msgGiftName]]; | |
| 537 | 539 | [self.giftListView addGiftAnimationWithModel:giftModel]; |
| 538 | 540 | |
| 539 | 541 | //将消息显示到列表中 | ... | ... |