Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
do_change_stream_invite_only: Ensure stream is not web public.
Aman Agrawal70c0abc2e59d
diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.mdindex b3484d53667..d641a7dcf57 100644--- a/templates/zerver/api/changelog.md+++ b/templates/zerver/api/changelog.md@@ -13,6 +13,11 @@ below features are supported.**Feature level 70**+* [`GET /events`](/api/get-events): Added `is_web_public` field to+ `stream` events changing `invite_only`.++**Feature level 70**+* [`POST /register`](/api/register-queue): Added new top-level`server_timestamp` field when fetching presence data, to match theexisting presence API.diff --git a/version.py b/version.pyindex 5a37ee2dc52..e61d764479e 100644--- a/version.py+++ b/version.py@@ -32,7 +32,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.-API_FEATURE_LEVEL = 70+API_FEATURE_LEVEL = 71# 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. Bumpdiff --git a/zerver/lib/actions.py b/zerver/lib/actions.pyindex b63aaae90ec..3bb5892f835 100644--- a/zerver/lib/actions.py+++ b/zerver/lib/actions.py@@ -4554,13 +4554,15 @@ def do_change_stream_invite_only()stream.invite_only = invite_onlystream.history_public_to_subscribers = history_public_to_subscribers- stream.save(update_fields=["invite_only", "history_public_to_subscribers"])+ stream.is_web_public = False+ stream.save(update_fields=["invite_only", "history_public_to_subscribers", "is_web_public"])event = dict(op="update",type="stream",property="invite_only",value=invite_only,history_public_to_subscribers=history_public_to_subscribers,+ is_web_public=False,stream_id=stream.id,name=stream.name,)diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.pyindex 3a29dcc1fd0..8b6f2afd573 100644--- a/zerver/lib/event_schema.py+++ b/zerver/lib/event_schema.py@@ -1183,6 +1183,7 @@ stream_update_event = event_dict_type(optional_keys=[("rendered_description", str),("history_public_to_subscribers", bool),+ ("is_web_public", bool),],)_check_stream_update = make_checker(stream_update_event)@@ -1213,7 +1214,7 @@ def check_stream_update(assert extra_keys == set()assert isinstance(value, str)elif prop == "invite_only":- assert extra_keys == {"history_public_to_subscribers"}+ assert extra_keys == {"history_public_to_subscribers", "is_web_public"}assert isinstance(value, bool)elif prop == "message_retention_days":assert extra_keys == set()diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex 50302543250..9951998a31d 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -1085,6 +1085,14 @@ paths:Currently always true for public streams (i.e. invite_only=False implieshistory_public_to_subscribers=True), but clients should not make thatassumption, as we may change that behavior in the future.+ is_web_public:+ type: boolean+ description: |+ Note: Only present if the changed property was `invite_only`.++ Whether the stream's history is now readable by web-public visitors.++ **Changes**: New in Zulip 5.0 (feature level 71).additionalProperties: falseexample:{@@ -1093,6 +1101,7 @@ paths:"property": "invite_only","value": true,"history_public_to_subscribers": true,+ "is_web_public": false,"stream_id": 11,"name": "test_stream","id": 0,