don't add badge for messages with no mention
This commit is contained in:
parent
423feae426
commit
38a19ad2d1
|
@ -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;
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue