Browse Source

Allow modifying the hide_notifications of a mute with the /api/v1/accounts/:id/mute endpoint

closed-social-glitch-2
Surinna Curtis 7 years ago
parent
commit
0284fd723b
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/models/concerns/account_interactions.rb

+ 5
- 1
app/models/concerns/account_interactions.rb View File

@ -75,7 +75,11 @@ module AccountInteractions
end
def mute!(other_account, notifications: true)
mute_relationships.create_with(hide_notifications: notifications).find_or_create_by!(target_account: other_account)
mute = mute_relationships.create_with(hide_notifications: notifications).find_or_create_by!(target_account: other_account)
if mute.hide_notifications? != notifications
mute.hide_notifications = notifications
mute.save!
end
end
def mute_conversation!(conversation)

Loading…
Cancel
Save