def unmute_topic(user_profile: UserProfile, stream_id: Optional[int], stream_name: Optional[str], topic_name: str) -> HttpResponse: error = _("Topic is not muted") if stream_name is not None: stream = access_stream_for_unmute_topic_by_name( user_profile, stream_name, error) else: assert stream_id is not None stream = access_stream_for_unmute_topic_by_id(user_profile, stream_id, error) do_unmute_topic(user_profile, stream, topic_name) return json_success()
def unmute_topic(user_profile: UserProfile, stream_id: Optional[int], stream_name: Optional[str], topic_name: str) -> HttpResponse: error = _("Topic is not muted") if stream_name is not None: stream = access_stream_for_unmute_topic_by_name(user_profile, stream_name, error) else: assert stream_id is not None stream = access_stream_for_unmute_topic_by_id(user_profile, stream_id, error) if not topic_is_muted(user_profile, stream.id, topic_name): return json_error(error) do_unmute_topic(user_profile, stream, topic_name) return json_success()