Commit f07a05efcadf4a6a652d647c95218c0442dc8763

Authored by niudaojian
1 parent 651c8f1d

0.6.3 版本 新版首页不显示 新闻号,直播号,家园入口,音频播放

CNLiveNewIMAManagerKit.podspec
@@ -8,7 +8,7 @@ @@ -8,7 +8,7 @@
8 8
9 Pod::Spec.new do |s| 9 Pod::Spec.new do |s|
10 s.name = 'CNLiveNewIMAManagerKit' 10 s.name = 'CNLiveNewIMAManagerKit'
11 - s.version = '0.6.1' 11 + s.version = '0.6.3'
12 s.summary = 'A short description of CNLiveNewIMAManagerKit.' 12 s.summary = 'A short description of CNLiveNewIMAManagerKit.'
13 13
14 #s.description = <<-DESC 14 #s.description = <<-DESC
CNLiveNewIMAManagerKit/Classes/Playform/IMAConversationManager.m
@@ -122,8 +122,15 @@ @@ -122,8 +122,15 @@
122 122
123 TIMConversation *conversation = (TIMConversation * )conversationId; 123 TIMConversation *conversation = (TIMConversation * )conversationId;
124 124
125 - //如果是未知的 后台消息,直接 跳出循环ƒ 125 + //判断后台创建的号,是否需要显示在会话列表上
126 if ([conversation.getReceiver hasPrefix:@"sys"]) { 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 if ([conversation.getReceiver isEqualToString:CNLifeHaoUserId] 134 if ([conversation.getReceiver isEqualToString:CNLifeHaoUserId]
128 || [conversation.getReceiver isEqualToString:CNFirendMomentVideoUploadFinishUserId] 135 || [conversation.getReceiver isEqualToString:CNFirendMomentVideoUploadFinishUserId]
129 || [conversation.getReceiver isEqualToString:CNWithdrawMessage] 136 || [conversation.getReceiver isEqualToString:CNWithdrawMessage]
@@ -136,12 +143,13 @@ @@ -136,12 +143,13 @@
136 || [conversation.getReceiver isEqualToString:CNWithRepastVerify] 143 || [conversation.getReceiver isEqualToString:CNWithRepastVerify]
137 || [conversation.getReceiver isEqualToString:CNWithService]) 144 || [conversation.getReceiver isEqualToString:CNWithService])
138 { 145 {
139 - NSLog(@"已知后台消息"); 146 + NSLog(@"需要显示在会话列表上");
140 }else{ 147 }else{
141 - NSLog(@"未知后台消息不添加到会话列表"); 148 + NSLog(@"不需要显示在会话列表上");
142 continue; 149 continue;
143 } 150 }
144 } 151 }
  152 +
145 if ([conversation.getReceiver hasPrefix:@"admin"]) continue; 153 if ([conversation.getReceiver hasPrefix:@"admin"]) continue;
146 154
147 __block IMAConversation *conv = nil; 155 __block IMAConversation *conv = nil;
@@ -207,6 +215,10 @@ @@ -207,6 +215,10 @@
207 // [_conversationList insertObject:familyGroupConversation atIndex:0]; 215 // [_conversationList insertObject:familyGroupConversation atIndex:0];
208 // } 216 // }
209 217
  218 + if (NewHomePage) {
  219 + break;
  220 + }
  221 +
210 /**创建家园会话并插入会话列表第一个位置*/ 222 /**创建家园会话并插入会话列表第一个位置*/
211 CNCreateFamilyGroupConversation *familyGroupConversation = [[CNCreateFamilyGroupConversation alloc] init]; 223 CNCreateFamilyGroupConversation *familyGroupConversation = [[CNCreateFamilyGroupConversation alloc] init];
212 [_conversationList insertObject:familyGroupConversation atIndex:0]; 224 [_conversationList insertObject:familyGroupConversation atIndex:0];
@@ -663,39 +675,52 @@ @@ -663,39 +675,52 @@
663 switch (mp.platformType) { 675 switch (mp.platformType) {
664 case IMPlatformTypeC: 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 return 2 + _toIndex; 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 break; 725 break;
701 case IMPlatformTypeB: 726 case IMPlatformTypeB:
@@ -1538,6 +1563,15 @@ @@ -1538,6 +1563,15 @@
1538 isBreak = YES; 1563 isBreak = YES;
1539 return isBreak; 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 if ([[conv getReceiver] isEqualToString:CNWithSubscri] || [[conv getReceiver] isEqualToString:CNFirendMomentUserId] || [[conv getReceiver] isEqualToString:CNDarenHaoUserId]) 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 = @&quot;sys_subscribe&quot;; @@ -104,7 +104,7 @@ static NSString *const CNWithSubscri = @&quot;sys_subscribe&quot;;
104 static NSString *const CNWithNews = @"sys_news"; 104 static NSString *const CNWithNews = @"sys_news";
105 //直播号 105 //直播号
106 static NSString *const CNWithLive = @"sys_live"; 106 static NSString *const CNWithLive = @"sys_live";
107 -//轻松一刻 107 +//视频号
108 static NSString *const CNWithVideo = @"sys_video"; 108 static NSString *const CNWithVideo = @"sys_video";
109 //服务号 109 //服务号
110 static NSString *const CNWithService = @"sys_service"; 110 static NSString *const CNWithService = @"sys_service";
CNLiveNewIMAManagerKit/Classes/TIMCategory/IMAConversation+ShowAPIs.m
@@ -108,7 +108,7 @@ @@ -108,7 +108,7 @@
108 } 108 }
109 else if ([recerive isEqualToString:CNWithVideo]) 109 else if ([recerive isEqualToString:CNWithVideo])
110 { 110 {
111 - return @"轻松一刻"; 111 + return @"视频号";
112 } 112 }
113 else if ([recerive isEqualToString:CNWithRepastPay]) 113 else if ([recerive isEqualToString:CNWithRepastPay])
114 { 114 {