From b2ba83bbdaef6f2f97a6502708a7ef5fe09347d1 Mon Sep 17 00:00:00 2001 From: Surinna Curtis Date: Sat, 9 Sep 2017 05:16:06 -0500 Subject: [PATCH] Allow modifying the hide_notifications of a mute with the /api/v1/accounts/:id/mute endpoint --- app/models/concerns/account_interactions.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/account_interactions.rb b/app/models/concerns/account_interactions.rb index c258bfbfc9..4a4265df22 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)