mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 22:48:16 +00:00
streams: Fix sending stream-related events to guests.
Previous behavior- - Guest did not receive stream creation events for new web-public streams. - Guest did not receive peer_add and peer_remove events for web-public and subscribed public streams. This commit fixes the behavior to be - - Guests now receive stream creation events for new web-public streams. - Guest now receive peer_add and peer_remove events for web-public and subscribed public streams.
This commit is contained in:
@@ -1389,14 +1389,18 @@ Output:
|
||||
|
||||
# Subscribe to a stream directly
|
||||
def subscribe(
|
||||
self, user_profile: UserProfile, stream_name: str, invite_only: bool = False
|
||||
self,
|
||||
user_profile: UserProfile,
|
||||
stream_name: str,
|
||||
invite_only: bool = False,
|
||||
is_web_public: bool = False,
|
||||
) -> Stream:
|
||||
realm = user_profile.realm
|
||||
try:
|
||||
stream = get_stream(stream_name, user_profile.realm)
|
||||
except Stream.DoesNotExist:
|
||||
stream, from_stream_creation = create_stream_if_needed(
|
||||
realm, stream_name, invite_only=invite_only
|
||||
realm, stream_name, invite_only=invite_only, is_web_public=is_web_public
|
||||
)
|
||||
bulk_add_subscriptions(realm, [stream], [user_profile], acting_user=None)
|
||||
return stream
|
||||
|
||||
Reference in New Issue
Block a user