diff options
author | Stan Hu <stanhu@gmail.com> | 2017-03-15 21:50:20 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2017-03-15 21:51:08 +0300 |
commit | 203bb0bc546cfa99272a858426904030d9292615 (patch) | |
tree | 18f68a88f9225b054e96992040bb69ddf09b0400 /app | |
parent | ba9ea195f87a99ffa2662c8f273599f16dca4478 (diff) |
Revert "Merge branch 'option-to-be-notified-of-own-activity' into 'master'
This reverts commit 5e9666880376b3f53edb95cba77b5642d3cc1810, reversing
changes made to b35378a938e22f745b6c6ea32b53cb50f9b6c627.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/profile/profile.js | 1 | ||||
-rw-r--r-- | app/controllers/profiles/notifications_controller.rb | 2 | ||||
-rw-r--r-- | app/services/notification_service.rb | 11 | ||||
-rw-r--r-- | app/views/profiles/notifications/show.html.haml | 5 |
4 files changed, 6 insertions, 13 deletions
diff --git a/app/assets/javascripts/profile/profile.js b/app/assets/javascripts/profile/profile.js index 4ccea0624ee..c38bc762675 100644 --- a/app/assets/javascripts/profile/profile.js +++ b/app/assets/javascripts/profile/profile.js @@ -25,7 +25,6 @@ bindEvents() { $('.js-preferences-form').on('change.preference', 'input[type=radio]', this.submitForm); $('#user_notification_email').on('change', this.submitForm); - $('#user_notified_of_own_activity').on('change', this.submitForm); $('.update-username').on('ajax:before', this.beforeUpdateUsername); $('.update-username').on('ajax:complete', this.afterUpdateUsername); $('.update-notifications').on('ajax:success', this.onUpdateNotifs); diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb index a271e2dfc4b..b8b71d295f6 100644 --- a/app/controllers/profiles/notifications_controller.rb +++ b/app/controllers/profiles/notifications_controller.rb @@ -17,6 +17,6 @@ class Profiles::NotificationsController < Profiles::ApplicationController end def user_params - params.require(:user).permit(:notification_email, :notified_of_own_activity) + params.require(:user).permit(:notification_email) end end diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index d12692ecc90..fdaba9b95fb 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -217,7 +217,7 @@ class NotificationService recipients = reject_unsubscribed_users(recipients, note.noteable) recipients = reject_users_without_access(recipients, note.noteable) - recipients.delete(note.author) unless note.author.notified_of_own_activity? + recipients.delete(note.author) recipients = recipients.uniq notify_method = "note_#{note.to_ability_name}_email".to_sym @@ -327,9 +327,8 @@ class NotificationService recipients ||= build_recipients( pipeline, pipeline.project, - pipeline.user, - action: pipeline.status, - skip_current_user: false).map(&:notification_email) + nil, # The acting user, who won't be added to recipients + action: pipeline.status).map(&:notification_email) if recipients.any? mailer.public_send(email_template, pipeline, recipients).deliver_later @@ -628,7 +627,7 @@ class NotificationService recipients = reject_unsubscribed_users(recipients, target) recipients = reject_users_without_access(recipients, target) - recipients.delete(current_user) if skip_current_user && !current_user.notified_of_own_activity? + recipients.delete(current_user) if skip_current_user recipients.uniq end @@ -637,7 +636,7 @@ class NotificationService recipients = add_labels_subscribers([], project, target, labels: labels) recipients = reject_unsubscribed_users(recipients, target) recipients = reject_users_without_access(recipients, target) - recipients.delete(current_user) unless current_user.notified_of_own_activity? + recipients.delete(current_user) recipients.uniq end diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index 51c4e8e5a73..5c5e5940365 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -34,11 +34,6 @@ .clearfix - = form_for @user, url: profile_notifications_path, method: :put do |f| - %label{ for: 'user_notified_of_own_activity' } - = f.check_box :notified_of_own_activity - %span Receive notifications about your own activity - %hr %h5 Groups (#{@group_notifications.count}) |