diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-24 18:52:41 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-03-24 18:52:41 +0000 |
commit | 3d8ecbc94fd7ca0583b8a14f6ddd9be92be40c41 (patch) | |
tree | df82928464c09ffd656b08afe70c7e26a8a9fc23 /app | |
parent | 55be026e59e71073400a334cf746613f88c1d206 (diff) | |
parent | 5818cf063bda5f6a96ccefe086b64a3699dd2c67 (diff) | |
download | gitlab-ce-3d8ecbc94fd7ca0583b8a14f6ddd9be92be40c41.tar.gz |
Merge branch 'no-emails-for-mentions' into 'master'
Don't send an email for "mentioned in" notes
Currently, an email is sent every time a mentionable is referenced by an issue, a commit or a merge request: if I comment "This MR is related to #5", the watchers get one email for the comment, and another one stating "Issue #5 was mentioned by issue #13".
This is annoying — but the biggest issue is when pushing an existing branch. Every issue referenced by commit messages in this branch will get a new mention (which is fine), and dozens of emails will be sent for all these new mentions (which is not).
This commit fixes the spam by avoiding to send an email when a new mention is added to an existing mentionable. In most cases the email notification sent by the mentioner is enough.
Diffstat (limited to 'app')
-rw-r--r-- | app/services/notification_service.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 5daf573630d..5a1499901c7 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -111,6 +111,7 @@ class NotificationService # ignore gitlab service messages return true if note.note =~ /\A_Status changed to closed_/ + return true if note.note =~ /\A_mentioned in / && note.system == true opts = { noteable_type: note.noteable_type, project_id: note.project_id } |