mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
muting: Record DateTime when a Topic is muted.
This includes the necessary migration to add the date_muted field to the MutedTopic class and populates it with a hard coded value.
This commit is contained in:
@@ -5286,8 +5286,11 @@ def do_set_alert_words(user_profile: UserProfile, alert_words: List[str]) -> Non
|
||||
set_user_alert_words(user_profile, alert_words)
|
||||
notify_alert_words(user_profile, alert_words)
|
||||
|
||||
def do_mute_topic(user_profile: UserProfile, stream: Stream, recipient: Recipient, topic: str) -> None:
|
||||
add_topic_mute(user_profile, stream.id, recipient.id, topic)
|
||||
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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user