]> cat aescling's git repositories - mastodon.git/commitdiff
Allow modifying the hide_notifications of a mute with the /api/v1/accounts/:id/mute...
authorSurinna Curtis <ekiru.0@gmail.com>
Sat, 9 Sep 2017 10:16:06 +0000 (05:16 -0500)
committerSurinna Curtis <ekiru.0@gmail.com>
Thu, 14 Sep 2017 02:47:30 +0000 (21:47 -0500)
app/models/concerns/account_interactions.rb

index c258bfbfc9243f7900fee274b67730be831118ac..4a4265df227ff1b381bd53594d918dc827b12f42 100644 (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)
This page took 0.024082 seconds and 3 git commands to generate.