events: Include all active streams in initial state data for admins.

Realm administrators already get creation and deletion events for all
streams, including private streams.  So these should be reflected in
the initial state data.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-04-06 16:34:11 -07:00
committed by Tim Abbott
parent 1de9444242
commit 8bd0ec2fca

View File

@@ -401,7 +401,9 @@ def fetch_initial_state_data(
# it uses data from state["subscriptions"] and other
# places.
if user_profile is not None:
state["streams"] = do_get_streams(user_profile)
state["streams"] = do_get_streams(
user_profile, include_all_active=user_profile.is_realm_admin
)
else:
# TODO: This line isn't used by the webapp because it
# gets these data via the `subscriptions` key; it will
@@ -602,7 +604,9 @@ def apply_event(
state["never_subscribed"] = sub_info.never_subscribed
if "streams" in state:
state["streams"] = do_get_streams(user_profile)
state["streams"] = do_get_streams(
user_profile, include_all_active=user_profile.is_realm_admin
)
for field in ["delivery_email", "email", "full_name"]:
if field in person and field in state: