Commit f07a05efcadf4a6a652d647c95218c0442dc8763
1 parent
651c8f1d
0.6.3 版本 新版首页不显示 新闻号,直播号,家园入口,音频播放
Showing
4 changed files
with
64 additions
and
30 deletions
CNLiveNewIMAManagerKit.podspec
CNLiveNewIMAManagerKit/Classes/Playform/IMAConversationManager.m
| ... | ... | @@ -122,8 +122,15 @@ |
| 122 | 122 | |
| 123 | 123 | TIMConversation *conversation = (TIMConversation * )conversationId; |
| 124 | 124 | |
| 125 | - //如果是未知的 后台消息,直接 跳出循环ƒ | |
| 125 | + //判断后台创建的号,是否需要显示在会话列表上 | |
| 126 | 126 | if ([conversation.getReceiver hasPrefix:@"sys"]) { |
| 127 | + | |
| 128 | + //新版首页,新闻号,直播号 不需要显示在会话列表上 | |
| 129 | + if (NewHomePage && ([conversation.getReceiver isEqualToString:CNWithNews]|| [conversation.getReceiver isEqualToString:CNWithLive])) { | |
| 130 | + NSLog(@"不需要显示在会话列表上"); | |
| 131 | + continue; | |
| 132 | + } | |
| 133 | + | |
| 127 | 134 | if ([conversation.getReceiver isEqualToString:CNLifeHaoUserId] |
| 128 | 135 | || [conversation.getReceiver isEqualToString:CNFirendMomentVideoUploadFinishUserId] |
| 129 | 136 | || [conversation.getReceiver isEqualToString:CNWithdrawMessage] |
| ... | ... | @@ -136,12 +143,13 @@ |
| 136 | 143 | || [conversation.getReceiver isEqualToString:CNWithRepastVerify] |
| 137 | 144 | || [conversation.getReceiver isEqualToString:CNWithService]) |
| 138 | 145 | { |
| 139 | - NSLog(@"已知后台消息"); | |
| 146 | + NSLog(@"需要显示在会话列表上"); | |
| 140 | 147 | }else{ |
| 141 | - NSLog(@"未知后台消息不添加到会话列表"); | |
| 148 | + NSLog(@"不需要显示在会话列表上"); | |
| 142 | 149 | continue; |
| 143 | 150 | } |
| 144 | 151 | } |
| 152 | + | |
| 145 | 153 | if ([conversation.getReceiver hasPrefix:@"admin"]) continue; |
| 146 | 154 | |
| 147 | 155 | __block IMAConversation *conv = nil; |
| ... | ... | @@ -207,6 +215,10 @@ |
| 207 | 215 | // [_conversationList insertObject:familyGroupConversation atIndex:0]; |
| 208 | 216 | // } |
| 209 | 217 | |
| 218 | + if (NewHomePage) { | |
| 219 | + break; | |
| 220 | + } | |
| 221 | + | |
| 210 | 222 | /**创建家园会话并插入会话列表第一个位置*/ |
| 211 | 223 | CNCreateFamilyGroupConversation *familyGroupConversation = [[CNCreateFamilyGroupConversation alloc] init]; |
| 212 | 224 | [_conversationList insertObject:familyGroupConversation atIndex:0]; |
| ... | ... | @@ -663,39 +675,52 @@ |
| 663 | 675 | switch (mp.platformType) { |
| 664 | 676 | case IMPlatformTypeC: |
| 665 | 677 | { |
| 666 | - /**是否有创建亲情群入口,默认有,如果被删了,就不存在了*/ | |
| 667 | - BOOL hasCreateFamily = YES; | |
| 668 | - | |
| 669 | - NSString *deletedCreateFamily = [[NSUserDefaults standardUserDefaults] objectForKey:CNDeletedCreateFamily]; | |
| 670 | - if ([deletedCreateFamily isEqualToString:@"1"]) { | |
| 671 | - //首页会话已经删除情亲群入口 | |
| 672 | - hasCreateFamily = NO; | |
| 678 | + if (NewHomePage) { | |
| 679 | + | |
| 680 | + if (!mp.isConnected) | |
| 681 | + { | |
| 682 | + //没联网 | |
| 683 | + return 1 + _toIndex; | |
| 684 | + } | |
| 685 | + | |
| 673 | 686 | } |
| 674 | - | |
| 675 | - if (!mp.isConnected && self.isPlay) | |
| 687 | + else | |
| 676 | 688 | { |
| 677 | - if (hasCreateFamily) { | |
| 678 | - //没联网&听见中国在播放&有情亲群 | |
| 679 | - return 3 + _toIndex; | |
| 689 | + /**是否有创建亲情群入口,默认有,如果被删了,就不存在了*/ | |
| 690 | + BOOL hasCreateFamily = YES; | |
| 691 | + | |
| 692 | + NSString *deletedCreateFamily = [[NSUserDefaults standardUserDefaults] objectForKey:CNDeletedCreateFamily]; | |
| 693 | + if ([deletedCreateFamily isEqualToString:@"1"]) { | |
| 694 | + //首页会话已经删除情亲群入口 | |
| 695 | + hasCreateFamily = NO; | |
| 680 | 696 | } |
| 681 | - //没联网&听见中国在播放 | |
| 682 | - return 2 + _toIndex; | |
| 683 | - } | |
| 684 | - if (!mp.isConnected || self.isPlay) { | |
| 685 | 697 | |
| 686 | - if (hasCreateFamily) { | |
| 687 | - //听见中国或者网络其中一个 & 有情亲群 | |
| 698 | + if (!mp.isConnected && self.isPlay) | |
| 699 | + { | |
| 700 | + if (hasCreateFamily) { | |
| 701 | + //没联网&听见中国在播放&有情亲群 | |
| 702 | + return 3 + _toIndex; | |
| 703 | + } | |
| 704 | + //没联网&听见中国在播放 | |
| 688 | 705 | return 2 + _toIndex; |
| 689 | 706 | } |
| 690 | - //听见中国或者网络其中一个 | |
| 691 | - return 1 + _toIndex; | |
| 707 | + if (!mp.isConnected || self.isPlay) { | |
| 708 | + | |
| 709 | + if (hasCreateFamily) { | |
| 710 | + //听见中国或者网络其中一个 & 有情亲群 | |
| 711 | + return 2 + _toIndex; | |
| 712 | + } | |
| 713 | + //听见中国或者网络其中一个 | |
| 714 | + return 1 + _toIndex; | |
| 715 | + | |
| 716 | + } | |
| 692 | 717 | |
| 718 | + if (hasCreateFamily) { | |
| 719 | + //联网 & 有情亲群 | |
| 720 | + return 1 + _toIndex; | |
| 721 | + } | |
| 693 | 722 | } |
| 694 | 723 | |
| 695 | - if (hasCreateFamily) { | |
| 696 | - //联网 & 有情亲群 | |
| 697 | - return 1 + _toIndex; | |
| 698 | - } | |
| 699 | 724 | } |
| 700 | 725 | break; |
| 701 | 726 | case IMPlatformTypeB: |
| ... | ... | @@ -1538,6 +1563,15 @@ |
| 1538 | 1563 | isBreak = YES; |
| 1539 | 1564 | return isBreak; |
| 1540 | 1565 | } |
| 1566 | + | |
| 1567 | + //新版首页会话列表上不显示新闻号,直播号 | |
| 1568 | + if (NewHomePage && ([conv.getReceiver isEqualToString:CNWithNews]|| [conv.getReceiver isEqualToString:CNWithLive])) { | |
| 1569 | + NSLog(@"不需要显示在会话列表上"); | |
| 1570 | + [[NSNotificationCenter defaultCenter] postNotificationName:kIMAMSG_UpdateHomePageHeaderNotification object:[conv getReceiver]]; | |
| 1571 | + isBreak = YES; | |
| 1572 | + return isBreak; | |
| 1573 | + } | |
| 1574 | + | |
| 1541 | 1575 | if ([[conv getReceiver] isEqualToString:CNWithSubscri] || [[conv getReceiver] isEqualToString:CNFirendMomentUserId] || [[conv getReceiver] isEqualToString:CNDarenHaoUserId]) |
| 1542 | 1576 | { |
| 1543 | 1577 | //订阅号 和 朋友圈 不添加到会话列表里 | ... | ... |
CNLiveNewIMAManagerKit/Classes/PublicHeader/IMAConstant.h
| ... | ... | @@ -104,7 +104,7 @@ static NSString *const CNWithSubscri = @"sys_subscribe"; |
| 104 | 104 | static NSString *const CNWithNews = @"sys_news"; |
| 105 | 105 | //直播号 |
| 106 | 106 | static NSString *const CNWithLive = @"sys_live"; |
| 107 | -//轻松一刻 | |
| 107 | +//视频号 | |
| 108 | 108 | static NSString *const CNWithVideo = @"sys_video"; |
| 109 | 109 | //服务号 |
| 110 | 110 | static NSString *const CNWithService = @"sys_service"; | ... | ... |
CNLiveNewIMAManagerKit/Classes/TIMCategory/IMAConversation+ShowAPIs.m