From 2c1a87166ca5bb4819fd71f78ada42dbb61d5ae7 Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Fri, 19 Nov 2021 15:36:59 +0530 Subject: [PATCH] register: Pass settings.WEB_PUBLIC_STREAMS_ENABLED to clients. This commit adds 'server_web_public_streams_enabled' field to the register response to pass settings.WEB_PUBLIC_STREAMS_ENABLED to clients. --- version.py | 2 +- zerver/lib/events.py | 1 + zerver/openapi/zulip.yaml | 10 ++++++++++ zerver/tests/test_home.py | 1 + 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/version.py b/version.py index cfe50a70ba..b8fa705048 100644 --- a/version.py +++ b/version.py @@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3" # Changes should be accompanied by documentation explaining what the # new level means in templates/zerver/api/changelog.md, as well as # "**Changes**" entries in the endpoint's documentation in `zulip.yaml`. -API_FEATURE_LEVEL = 109 +API_FEATURE_LEVEL = 110 # Bump the minor PROVISION_VERSION to indicate that folks should provision # only when going from an old version of the code to a newer version. Bump diff --git a/zerver/lib/events.py b/zerver/lib/events.py index d09ac054bb..f725f2459a 100644 --- a/zerver/lib/events.py +++ b/zerver/lib/events.py @@ -293,6 +293,7 @@ def fetch_initial_state_data( state["server_inline_url_embed_preview"] = settings.INLINE_URL_EMBED_PREVIEW state["server_avatar_changes_disabled"] = settings.AVATAR_CHANGES_DISABLED state["server_name_changes_disabled"] = settings.NAME_CHANGES_DISABLED + state["server_web_public_streams_enabled"] = settings.WEB_PUBLIC_STREAMS_ENABLED state["giphy_rating_options"] = realm.GIPHY_RATING_OPTIONS state["server_needs_upgrade"] = is_outdated_server(user_profile) diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml index 44b1dffc50..28c185f81f 100644 --- a/zerver/openapi/zulip.yaml +++ b/zerver/openapi/zulip.yaml @@ -11100,6 +11100,16 @@ paths: such that the web app will display to the current user a prominent warning. **Changes**: New in Zulip 5.0 (feature level 74). + server_web_public_streams_enabled: + type: boolean + description: | + Present if `realm` is present in `fetch_event_types`. + + Whether web public streams are enabled in the server. Similar topic_name + `realm_enable_spectator_access` but based on the `WEB_PUBLIC_STREAMS_ENABLED` + Zulip server level setting. + + **Changes**: New in Zulip 5.0 (feature level 110). event_queue_longpoll_timeout_seconds: type: integer description: | diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py index 4bcfcd94e2..eb7dbc56c2 100644 --- a/zerver/tests/test_home.py +++ b/zerver/tests/test_home.py @@ -190,6 +190,7 @@ class HomeTest(ZulipTestCase): "server_name_changes_disabled", "server_needs_upgrade", "server_timestamp", + "server_web_public_streams_enabled", "settings_send_digest_emails", "show_billing", "show_plans",