-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Notification not working for group mentions and not respecting ignored users #11024
Changes from 1 commit
c761ab6
f78a9b0
37ac9bc
8d87572
9e4719e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ const sendNotification = ({ | |
} | ||
|
||
// dont send notification to users who ignored the sender | ||
if (Array.isArray(subscription.ignored) && subscription.ignored.find(sender._id)) { | ||
if (Array.isArray(subscription.ignored) && subscription.ignored.includes(sender._id)) { | ||
return; | ||
} | ||
|
||
|
@@ -199,11 +199,15 @@ function sendAllNotifications(message, room) { | |
[notificationField]: 'mentions', | ||
'u._id': { $in: mentionIdsWithoutGroups } | ||
}); | ||
} else if ((hasMentionToAll || hasMentionToHere) && !disableAllMessageNotifications) { | ||
query.$or.push({ | ||
[notificationField]: 'mentions' | ||
}); | ||
} | ||
|
||
const serverField = kind === 'email' ? 'emailNotificationMode' : `${ kind }Notifications`; | ||
const serverPreference = RocketChat.settings.get(`Accounts_Default_User_Preferences_${ serverField }`); | ||
if ((room.t === 'd' && serverPreference === 'mentions') || (serverPreference === 'all' && !disableAllMessageNotifications)) { | ||
if ((room.t === 'd' && serverPreference === 'mentions') || ((serverPreference === 'all' || hasMentionToAll || hasMentionToHere) && !disableAllMessageNotifications)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we really need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes we do.. because |
||
query.$or.push({ | ||
[notificationField]: { $exists: false } | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like to make small tests before
what do you think?