mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
subs: Fix clearing unread counts when leaving private streams.
Because we use access_stream_by_id here, and that checks for an active subscription to interact with a private stream, this didn't work. The correct fix to add an option to active_stream_by_id to accept an argument indicating whether we need an active subscription; for this use case, we definitely do not.
This commit is contained in:
@@ -517,5 +517,9 @@ class DeferredWorker(QueueProcessingWorker):
|
||||
user_profile = get_user_profile_by_id(event['user_profile_id'])
|
||||
|
||||
for stream_id in event['stream_ids']:
|
||||
(stream, recipient, sub) = access_stream_by_id(user_profile, stream_id)
|
||||
# Since the user just unsubscribed, we don't require
|
||||
# an active Subscription object (otherwise, private
|
||||
# streams would never be accessible)
|
||||
(stream, recipient, sub) = access_stream_by_id(user_profile, stream_id,
|
||||
require_active=False)
|
||||
do_mark_stream_messages_as_read(user_profile, stream)
|
||||
|
||||
Reference in New Issue
Block a user