register: Include web-public streams in "streams" field of response.

The "streams" field in "/register" response did not include web-public
streams for non-admin users but the data for those are eventually
included in the subscriptions data sent using "subscriptions",
"unsubscribed" and "never_subscribed" fields.

This commit adds code to include the web-public streams in "streams"
field as well as everyone can access those and will make the "streams"
data complete.
This commit is contained in:
Sahil Batra 2023-07-06 22:24:20 +05:30 committed by Tim Abbott
parent 53e081ae29
commit b92af18928
3 changed files with 14 additions and 2 deletions

View File

@ -20,6 +20,11 @@ format used by the Zulip server that they are interacting with.
## Changes in Zulip 8.0 ## Changes in Zulip 8.0
**Feature level 205**
* [`POST /register`](/api/register-queue): `streams` field in the response
now included web-public streams as well.
**Feature level 204** **Feature level 204**
* [`POST /register`](/api/register-queue): Added * [`POST /register`](/api/register-queue): Added

View File

@ -572,7 +572,9 @@ def fetch_initial_state_data(
# places. # places.
if user_profile is not None: if user_profile is not None:
state["streams"] = do_get_streams( state["streams"] = do_get_streams(
user_profile, include_all_active=user_profile.is_realm_admin user_profile,
include_web_public=True,
include_all_active=user_profile.is_realm_admin,
) )
else: else:
# TODO: This line isn't used by the web app because it # TODO: This line isn't used by the web app because it
@ -895,7 +897,9 @@ def apply_event(
if "streams" in state: if "streams" in state:
state["streams"] = do_get_streams( state["streams"] = do_get_streams(
user_profile, include_all_active=user_profile.is_realm_admin user_profile,
include_web_public=True,
include_all_active=user_profile.is_realm_admin,
) )
if state["is_guest"]: if state["is_guest"]:

View File

@ -11804,6 +11804,9 @@ paths:
For organization administrators, this will include all private streams For organization administrators, this will include all private streams
in the organization. in the organization.
**Changes**: As of Zulip 8.0 (feature level 205), this will include all
web-public streams in the organization as well.
realm_default_streams: realm_default_streams:
type: array type: array
items: items: