mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
This query counts the number of messages each user has sent, subgroup'd by whether the message was a private_message (PM or sent to a huddle), sent to a 'private_stream', or sent to a 'public_stream'. We need to join on zerver_stream to find out whether stream messages were sent to public streams or private streams, but it needs to be a LEFT JOIN rather than a JOIN so that we preserve the messages sent to non-streams.