mirror of
https://github.com/wekan/wekan.git
synced 2026-03-06 05:40:16 +01:00
Fix mentions and notifications drawer.
Thanks to xet7 ! Fixes #6062, fixes #6003, fixes #5996, fixes #5720, fixes #5911, fixes #5792, fixes #5163, fixes #4431, fixes #4126, fixes #3363, fixes #3150
This commit is contained in:
parent
0d5dd3082c
commit
20b5e2ab8f
14 changed files with 225 additions and 72 deletions
|
|
@ -212,14 +212,13 @@ if (Meteor.isServer) {
|
|||
});
|
||||
const mentionRegex = /\B@(?:(?:"([\w.\s-]*)")|([\w.-]+))/gi; // including space in username
|
||||
let currentMention;
|
||||
|
||||
while ((currentMention = mentionRegex.exec(comment)) !== null) {
|
||||
/*eslint no-unused-vars: ["error", { "varsIgnorePattern": "[iI]gnored" }]*/
|
||||
const [ignored, quoteduser, simple] = currentMention;
|
||||
const username = quoteduser || simple;
|
||||
if (username === params.user) {
|
||||
// ignore commenter mention himself?
|
||||
continue;
|
||||
}
|
||||
// Removed the check that prevented self-mentions from creating notifications
|
||||
// Users can now mention themselves in comments to create notifications
|
||||
|
||||
if (activity.boardId && username === 'board_members') {
|
||||
// mentions all board members
|
||||
|
|
@ -335,8 +334,9 @@ if (Meteor.isServer) {
|
|||
);
|
||||
}
|
||||
Notifications.getUsers(watchers).forEach((user) => {
|
||||
// don't notify a user of their own behavior
|
||||
if (user._id !== userId) {
|
||||
// Don't notify a user of their own behavior, EXCEPT for self-mentions
|
||||
const isSelfMention = (user._id === userId && title === 'act-atUserComment');
|
||||
if (user._id !== userId || isSelfMention) {
|
||||
Notifications.notify(user, title, description, params);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue