Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
refactor: Remove recipient arg for do_mute_topic.
Steve Howell3685fcc7016b
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.pyindex facca8ec1b0..d30efc281e9 100644--- a/zerver/lib/actions.py+++ b/zerver/lib/actions.py@@ -5461,11 +5461,15 @@ def do_remove_alert_words(user_profile: UserProfile, alert_words: Iterable[str])words = remove_user_alert_words(user_profile, alert_words)notify_alert_words(user_profile, words)-def do_mute_topic(user_profile: UserProfile, stream: Stream, recipient: Recipient, topic: str,- date_muted: Optional[datetime.datetime]=None) -> None:+def do_mute_topic(+ user_profile: UserProfile,+ stream: Stream,+ topic: str,+ date_muted: Optional[datetime.datetime]=None+) -> None:if date_muted is None:date_muted = timezone_now()- add_topic_mute(user_profile, stream.id, recipient.id, topic, date_muted)+ add_topic_mute(user_profile, stream.id, stream.recipient_id, topic, date_muted)event = dict(type="muted_topics", muted_topics=get_topic_mutes(user_profile))send_event(user_profile.realm, event, [user_profile.id])diff --git a/zerver/tests/test_event_queue.py b/zerver/tests/test_event_queue.pyindex c2955988115..3c47909a4b0 100644--- a/zerver/tests/test_event_queue.py+++ b/zerver/tests/test_event_queue.py@@ -441,7 +441,7 @@ class MissedMessageNotificationsTest(ZulipTestCase):'email_notifications': False})self.assertTrue(client_descriptor.event_queue.empty())- do_mute_topic(user_profile, stream, sub.recipient, "mutingtest")+ do_mute_topic(user_profile, stream, "mutingtest")msg_id = self.send_stream_message(self.example_user("iago"), "Denmark",content="what's up everyone?", topic_name="mutingtest")with mock.patch("zerver.tornado.event_queue.maybe_enqueue_notifications") as mock_enqueue:diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.pyindex 12c9f6cef66..4664f1deafe 100644--- a/zerver/tests/test_events.py+++ b/zerver/tests/test_events.py@@ -954,12 +954,10 @@ class NormalActionsTest(BaseAction):def test_muted_topics_events(self) -> None:stream = get_stream('Denmark', self.user_profile.realm)- recipient = stream.recipientevents = self.verify_action(lambda: do_mute_topic(self.user_profile,stream,- recipient,"topic"))check_muted_topics('events[0]', events[0])diff --git a/zerver/views/muting.py b/zerver/views/muting.pyindex c4f46c5aee5..8887cd86da2 100644--- a/zerver/views/muting.py+++ b/zerver/views/muting.py@@ -34,7 +34,7 @@ def mute_topic(user_profile: UserProfile,if topic_is_muted(user_profile, stream.id, topic_name):return json_error(_("Topic already muted"))- do_mute_topic(user_profile, stream, recipient, topic_name, date_muted)+ do_mute_topic(user_profile, stream, topic_name, date_muted)return json_success()def unmute_topic(user_profile: UserProfile,