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 Alex Vandiver
parent edf1de5416
commit c90fd388c8
3 changed files with 17 additions and 2 deletions

View File

@@ -18,6 +18,14 @@ clients should check the `zulip_feature_level` field, present in the
/register`](/api/register-queue) responses, to determine the API
format used by the Zulip server that they are interacting with.
## Changes in Zulip 7.5
**Feature level 186**
* [`POST /register`](/api/register-queue): `streams` field in the response
now included web-public streams as well. This change was backported from
Zulip 8.0, where it was introduced in feature level 205.
## Changes in Zulip 7.0
**Feature level 185**

View File

@@ -565,7 +565,9 @@ def fetch_initial_state_data(
# places.
if user_profile is not None:
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:
# TODO: This line isn't used by the web app because it
@@ -889,7 +891,9 @@ def apply_event(
if "streams" in state:
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"]:

View File

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