mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
The grouping logic in `do_delete_messages` calls `message.is_stream_message()` in a loop, which needs to access message.recipient. This is obviously super inefficient if .recipient hasn't been prefetched for the message objects. `delete_in_topic` is the only function that calls `do_delete_messages` with many messages, so this is the only spot we need to fix, to address the immediate bug. Of course a better improvement would be to fix `do_delete_messages` to do something smarter than naively accessing message.recipient in a loop.