about summary refs log tree commit diff
path: root/app/lib/user_settings_decorator.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-04-08 18:03:31 +0200
committerGitHub <noreply@github.com>2022-04-08 18:03:31 +0200
commit8e20e16cf030fef48850df4764bbf13a317f6b0c (patch)
tree3ae94f1665c7cc80df310edf688758dd67cd69e5 /app/lib/user_settings_decorator.rb
parentfd9a9b07c2cd19ef08d15e138fd3fc59fc5318b6 (diff)
Change e-mail notifications to only be sent when recipient is offline (#17984)
* Change e-mail notifications to only be sent when recipient is offline

Change the default for follow and mention notifications back on

* Add preference to always send e-mail notifications

* Change wording
Diffstat (limited to 'app/lib/user_settings_decorator.rb')
-rw-r--r--app/lib/user_settings_decorator.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb
index de054e403..5fb7655a9 100644
--- a/app/lib/user_settings_decorator.rb
+++ b/app/lib/user_settings_decorator.rb
@@ -38,6 +38,7 @@ class UserSettingsDecorator
     user.settings['use_pending_items']   = use_pending_items_preference if change?('setting_use_pending_items')
     user.settings['trends']              = trends_preference if change?('setting_trends')
     user.settings['crop_images']         = crop_images_preference if change?('setting_crop_images')
+    user.settings['always_send_emails']  = always_send_emails_preference if change?('setting_always_send_emails')
   end
 
   def merged_notification_emails
@@ -132,6 +133,10 @@ class UserSettingsDecorator
     boolean_cast_setting 'setting_crop_images'
   end
 
+  def always_send_emails_preference
+    boolean_cast_setting 'setting_always_send_emails'
+  end
+
   def boolean_cast_setting(key)
     ActiveModel::Type::Boolean.new.cast(settings[key])
   end