def do_mute_topic(user_profile: UserProfile, stream: Stream, recipient: Recipient, 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)
    event = dict(type='muted_topics', muted_topics=get_topic_mutes(user_profile))
    send_event(user_profile.realm, event, [user_profile.id])
def do_mute_topic(user_profile: UserProfile, stream: Stream, recipient: Recipient, 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)
    event = dict(type='muted_topics', muted_topics=get_topic_mutes(user_profile))
    send_event(user_profile.realm, event, [user_profile.id])