]> cat aescling's git repositories - mastodon.git/commitdiff
always allow DMs from staff (#8993)
authorQuint Guvernator <quint@guvernator.net>
Tue, 16 Oct 2018 17:55:05 +0000 (13:55 -0400)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 16 Oct 2018 17:55:05 +0000 (19:55 +0200)
app/services/notify_service.rb

index 63bf8f17ab4602d310076f52d4e62c776367b1de..49022a844e9e1fe867e1ff389b92bbfb0649346b 100644 (file)
@@ -59,9 +59,14 @@ class NotifyService < BaseService
     @notification.target_status.in_reply_to_account_id == @recipient.id && @notification.target_status.thread&.direct_visibility?
   end
 
+  def from_staff?
+    @notification.from_account.local? && @notification.from_account.user.present? && @notification.from_account.user.staff?
+  end
+
   def optional_non_following_and_direct?
     direct_message? &&
       @recipient.user.settings.interactions['must_be_following_dm'] &&
+      !from_staff? &&
       !following_sender? &&
       !response_to_recipient?
   end