mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
delete_message: Fix recipients of "delete_message" event.
Earlier, we were sending 'delete_message' event to all active subscribers of the stream. We shouldn't send event to those users who don't have access to the deleted message in a private stream with protected history. This commit fixes that bug. Also, now we use 'event_recipient_ids_for_action_on_messages'. It helps to add hardening such that if the invariant "no usermessage row corresponding to a message exists if the user loses access to the message" is violated due to some bug, it has minimal user impact.
This commit is contained in:
committed by
Tim Abbott
parent
388464fcf4
commit
d6c48b7185
@@ -554,7 +554,7 @@ class DeleteMessageTest(ZulipTestCase):
|
||||
self.assertEqual(stream.first_message_id, message_ids[1])
|
||||
|
||||
all_messages = Message.objects.filter(id__in=message_ids)
|
||||
with self.assert_database_query_count(24):
|
||||
with self.assert_database_query_count(25):
|
||||
do_delete_messages(realm, all_messages, acting_user=None)
|
||||
stream = get_stream(stream_name, realm)
|
||||
self.assertEqual(stream.first_message_id, None)
|
||||
|
||||
Reference in New Issue
Block a user