Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

register: Add `realm_empty_topic_display_name` in /register response.

Prakhar Pratyush9f1dc08ff218
diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index 92379d0d42e..13d48cea294 100644
--- a/api_docs/changelog.md
+++ b/api_docs/changelog.md
@@ -20,6 +20,12 @@ format used by the Zulip server that they are interacting with.
## Changes in Zulip 10.0
+**Feature level 334**
+
+* [`POST /register`](/api/register-queue): Added
+ `realm_empty_topic_display_name` field for clients to use
+ while adding support for empty string as topic name.
+
**Feature level 333**
* [Message formatting](/api/message-formatting): System groups can now
diff --git a/zerver/lib/events.py b/zerver/lib/events.py
index 4951af8c6e0..5dbd1b6497f 100644
--- a/zerver/lib/events.py
+++ b/zerver/lib/events.py
@@ -479,6 +479,7 @@ def fetch_initial_state_data(
settings.MAX_DEACTIVATED_REALM_DELETION_DAYS
)
+ state["realm_empty_topic_display_name"] = "testing general chat"
if want("realm_user_settings_defaults"):
realm_user_default = RealmUserDefault.objects.get(realm=realm)
state["realm_user_settings_defaults"] = {}
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index b649ac9bfb0..3603bde6d27 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -17679,6 +17679,21 @@ paths:
primarily relevant to clients containing UI for changing it.
**Changes**: New in Zulip 9.0 (feature level 242).
+ realm_empty_topic_display_name:
+ type: string
+ description: |
+ Present if `realm` is present in `fetch_event_types`.
+
+ Clients declaring the `empty_topic_name` client capability
+ should use the value of `realm_empty_topic_display_name` to
+ determine how to display the empty string topic.
+
+ Clients not declaring the `empty_topic_name` client capability
+ receive `realm_empty_topic_display_name` value as the topic name
+ replacing empty string.
+
+ **Changes**: New in Zulip 10.0 (feature level 334). Previously,
+ the empty string was not a valid topic name.
realm_user_settings_defaults:
type: object
additionalProperties: false
diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py
index 02a5eed2bc4..88e876cbdb0 100644
--- a/zerver/tests/test_home.py
+++ b/zerver/tests/test_home.py
@@ -162,6 +162,7 @@ class HomeTest(ZulipTestCase):
"realm_emails_restricted_to_domains",
"realm_embedded_bots",
"realm_emoji",
+ "realm_empty_topic_display_name",
"realm_enable_guest_user_indicator",
"realm_enable_read_receipts",
"realm_enable_spectator_access",