房间内私聊放出订阅提醒 活动通知等

This commit is contained in:
fengshuo
2023-01-07 15:40:25 +08:00
parent c44ab76ef4
commit d6f67b4030

View File

@@ -91,6 +91,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
self = [self init]; self = [self init];
if (self) { if (self) {
_openType = type; _openType = type;
[self initDatas];
} }
return self; return self;
} }
@@ -182,7 +183,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
NSMutableArray<NSString *> * uids = [[NSMutableArray alloc] init]; NSMutableArray<NSString *> * uids = [[NSMutableArray alloc] init];
NSMutableArray *officalArray = [NSMutableArray array]; NSMutableArray *officalArray = [NSMutableArray array];
[self.recentSessions enumerateObjectsUsingBlock:^(NIMRecentSession * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [self.recentSessions enumerateObjectsUsingBlock:^(NIMRecentSession * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:obj.session.sessionId]) { if (self.openType != SessionListOpenTypeRoom && [[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:obj.session.sessionId]) {
[officalArray addObject:obj]; [officalArray addObject:obj];
[self.headView updateBadgeWithSessionId:obj.session.sessionId unreadCount:obj.unreadCount]; [self.headView updateBadgeWithSessionId:obj.session.sessionId unreadCount:obj.unreadCount];
} else { } else {
@@ -271,7 +272,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (void)didAddRecentSession:(NIMRecentSession *)recentSession - (void)didAddRecentSession:(NIMRecentSession *)recentSession
totalUnreadCount:(NSInteger)totalUnreadCount { totalUnreadCount:(NSInteger)totalUnreadCount {
if([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId]) { if(self.openType != SessionListOpenTypeRoom && [[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId]) {
[self.headView updateBadgeWithSessionId:recentSession.session.sessionId unreadCount:recentSession.unreadCount]; [self.headView updateBadgeWithSessionId:recentSession.session.sessionId unreadCount:recentSession.unreadCount];
return; return;
} }
@@ -293,7 +294,7 @@ NSString * const kMessageShowReadDotKey = @"kMessageShowReadDotKey";
- (void)didUpdateRecentSession:(NIMRecentSession *)recentSession - (void)didUpdateRecentSession:(NIMRecentSession *)recentSession
totalUnreadCount:(NSInteger)totalUnreadCount { totalUnreadCount:(NSInteger)totalUnreadCount {
if([[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId]) { if(self.openType != SessionListOpenTypeRoom && [[ClientConfig shareConfig].configInfo.officialMsgUids containsObject:recentSession.session.sessionId]) {
[self.headView updateBadgeWithSessionId:recentSession.session.sessionId unreadCount:recentSession.unreadCount]; [self.headView updateBadgeWithSessionId:recentSession.session.sessionId unreadCount:recentSession.unreadCount];
return; return;
} }