about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorSurinna Curtis <ekiru.0@gmail.com>2017-09-09 05:16:06 -0500
committerSurinna Curtis <ekiru.0@gmail.com>2017-09-13 21:47:30 -0500
commit0284fd723b4d45ab2b381ee0c4f6550f44d3abf5 (patch)
tree3ba0c32d1c178bb90af25630c443637e49d7fdc6 /app/models
parent0e0703dbd8c9055c4fdf93c7b29ae387043e9937 (diff)
Allow modifying the hide_notifications of a mute with the /api/v1/accounts/:id/mute endpoint
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/account_interactions.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb
index c258bfbfc..4a4265df2 100644
--- a/app/models/concerns/account_interactions.rb
+++ b/app/models/concerns/account_interactions.rb
@@ -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)