Skip to content

Commit

Permalink
Always let through notifications from staff (#9152)
Browse files Browse the repository at this point in the history
* Always let through notifications from staff

Follow-up to #8993

* Let messages from staff through, but no other notifications
  • Loading branch information
Gargron authored Oct 30, 2018
1 parent a03d506 commit 47b8d19
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/services/notify_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ def optional_non_following?
@recipient.user.settings.interactions['must_be_following'] && !following_sender?
end

def message?
@notification.type == :mention
end

def direct_message?
@notification.type == :mention && @notification.target_status.direct_visibility?
message? && @notification.target_status.direct_visibility?
end

def response_to_recipient?
Expand All @@ -66,7 +70,6 @@ def from_staff?
def optional_non_following_and_direct?
direct_message? &&
@recipient.user.settings.interactions['must_be_following_dm'] &&
!from_staff? &&
!following_sender? &&
!response_to_recipient?
end
Expand All @@ -86,6 +89,9 @@ def domain_blocking?
def blocked?
blocked = @recipient.suspended? # Skip if the recipient account is suspended anyway
blocked ||= from_self? # Skip for interactions with self

return blocked if message? && from_staff?

blocked ||= domain_blocking? # Skip for domain blocked accounts
blocked ||= @recipient.blocking?(@notification.from_account) # Skip for blocked accounts
blocked ||= @recipient.muting_notifications?(@notification.from_account)
Expand Down

0 comments on commit 47b8d19

Please sign in to comment.