mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
Don't let non-subscribers of invite-only streams query the membership.
(imported from commit 01bd8ea089dec96e487e5e82fb38df65703679ae)
This commit is contained in:
@@ -346,6 +346,17 @@ def process_user_activity_event(event):
|
||||
query = event["query"]
|
||||
return do_update_user_activity(user_profile, client, query, log_time)
|
||||
|
||||
def subscribed_to_stream(user_profile, stream):
|
||||
try:
|
||||
if Subscription.objects.get(user_profile=user_profile,
|
||||
active=True,
|
||||
recipient__type=Recipient.STREAM,
|
||||
recipient__type_id=stream.id):
|
||||
return True
|
||||
return False
|
||||
except Subscription.DoesNotExist:
|
||||
return False
|
||||
|
||||
def gather_subscriptions(user_profile):
|
||||
# This is a little awkward because the StreamColor table has foreign keys
|
||||
# to Subscription, but not vice versa, and not all Subscriptions have a
|
||||
|
||||
Reference in New Issue
Block a user