mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
Prevent missed-message emails for deleted messages.
This of course only works in the 2 minute window where missed-message emails are planned, but nonetheless likely avoids common cases of emailing users with deleted messages. Fixes: #3873.
This commit is contained in:
committed by
Tim Abbott
parent
ceac6d9c59
commit
a61ff3e234
@@ -335,6 +335,10 @@ def handle_missedmessage_emails(user_profile_id, missed_email_events):
|
||||
messages = Message.objects.filter(usermessage__user_profile_id=user_profile,
|
||||
id__in=message_ids,
|
||||
usermessage__flags=~UserMessage.flags.read)
|
||||
|
||||
# Cancel missed-message emails for deleted messages
|
||||
messages = [um for um in messages if um.content != "(deleted)"]
|
||||
|
||||
if not messages:
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user