|
|
@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
YapDatabaseViewTransaction *unreadMessages = [transaction ext:TSUnreadDatabaseViewExtensionName];
|
|
|
|
YapDatabaseViewTransaction *unreadMessages = [transaction ext:TSUnreadDatabaseViewExtensionName];
|
|
|
|
NSArray<NSString *> *allGroups = [unreadMessages allGroups];
|
|
|
|
NSArray<NSString *> *allGroups = [unreadMessages allGroups];
|
|
|
|
for (NSString *groupID in allGroups) {
|
|
|
|
for (NSString *groupID in allGroups) {
|
|
|
|
TSThread *thread = [TSThread fetchObjectWithUniqueID:groupID transaction:transaction];
|
|
|
|
TSGroupThread *thread = [TSGroupThread fetchObjectWithUniqueID:groupID transaction:transaction];
|
|
|
|
if (thread.isMuted) continue;
|
|
|
|
if (thread.isMuted) continue;
|
|
|
|
[unreadMessages enumerateKeysAndObjectsInGroup:groupID
|
|
|
|
[unreadMessages enumerateKeysAndObjectsInGroup:groupID
|
|
|
|
usingBlock:^(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop) {
|
|
|
|
usingBlock:^(NSString *collection, NSString *key, id object, NSUInteger index, BOOL *stop) {
|
|
|
@ -85,6 +85,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
NSLog(@"Found an already read message in the * unread * messages list.");
|
|
|
|
NSLog(@"Found an already read message in the * unread * messages list.");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TSIncomingMessage * incomingMessage = (TSIncomingMessage *)object;
|
|
|
|
|
|
|
|
if (incomingMessage != nil && thread.isOnlyNotifyingForMentions && !incomingMessage.isUserMentioned) {
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
count += 1;
|
|
|
|
count += 1;
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|