mirror of https://github.com/zulip/zulip.git
Update mentioned flags after message edits.
(imported from commit 67886db571193a0f53cf72aa00af9e5e75729dc0)
This commit is contained in:
parent
997eb82f85
commit
3e48b4fd95
|
@ -1514,6 +1514,8 @@ def truncate_topic(topic):
|
|||
|
||||
|
||||
def update_user_message_flags(message, ums):
|
||||
wildcard = message.mentions_wildcard
|
||||
mentioned_ids = message.mentions_user_ids
|
||||
ids_with_alert_words = message.user_ids_with_alert_words
|
||||
changed_ums = set()
|
||||
|
||||
|
@ -1531,6 +1533,11 @@ def update_user_message_flags(message, ums):
|
|||
has_alert_word = um.user_profile_id in ids_with_alert_words
|
||||
update_flag(um, has_alert_word, UserMessage.flags.has_alert_word)
|
||||
|
||||
mentioned = um.user_profile_id in mentioned_ids
|
||||
update_flag(um, mentioned, UserMessage.flags.mentioned)
|
||||
|
||||
update_flag(um, wildcard, UserMessage.flags.wildcard_mentioned)
|
||||
|
||||
for um in changed_ums:
|
||||
um.save(update_fields=['flags'])
|
||||
|
||||
|
|
Loading…
Reference in New Issue