Merge pull request #6359 from jfsiebel/unread-chat-notification

Fix unread chat notification.
This commit is contained in:
Anton Georgiev 2018-12-10 13:36:33 -05:00 committed by GitHub
commit f375d4ab14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,10 +40,12 @@ class UnreadMessagesTracker {
sender: { $ne: Auth.userID },
};
if (chatID === PUBLIC_GROUP_CHAT_ID) {
filter.chatId = { $not: { $ne: chatID } };
filter.chatId = { $eq: chatID };
} else {
const privateChat = GroupChat.findOne({ users: { $all: [chatID, Auth.userID] } });
filter.chatId = { $ne: PUBLIC_GROUP_CHAT_ID };
if (privateChat) {
filter.chatId = privateChat.chatId;
}