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_uuid` in `/register` response.

Prakhar Pratyush435642290efc
diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index 089a3cb59ff..4f6631f5dd5 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 12.0
+**Feature level 466**
+
+* [`POST /register`](/api/register-queue): Added `realm_uuid`
+ field to response. Used by clients that prefer to compute
+ Jdenticon avatars locally.
+
**Feature level 465**
* [`POST /register`](/api/register-queue), [`GET /events`](/api/get-events),
diff --git a/version.py b/version.py
index 9c87e299384..88b846213c6 100644
--- a/version.py
+++ b/version.py
@@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"
# https://zulip.readthedocs.io/en/latest/documentation/api.html#step-by-step-guide
# Also available at docs/documentation/api.md.
-API_FEATURE_LEVEL = 465
+API_FEATURE_LEVEL = 466
# 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 dc63e39d5a8..41ffbd1cc47 100644
--- a/zerver/lib/events.py
+++ b/zerver/lib/events.py
@@ -642,6 +642,8 @@ def fetch_initial_state_data(
realm.topics_policy == RealmTopicsPolicyEnum.disable_empty_topic.value
)
+ state["realm_uuid"] = str(realm.uuid)
+
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 e6ee4e573fb..e5280c63421 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -19553,6 +19553,18 @@ paths:
**Changes**: New in Zulip 9.0 (feature level 257), replacing the
deprecated `realm_uri`.
+ realm_uuid:
+ type: string
+ description: |
+ Present if `realm` is present in `fetch_event_types`.
+
+ A unique identifier for the organization, expected to be stable
+ even if the organization migrates between hosting environments.
+
+ Used as the salt for Jdenticon avatars; Clients that prefer to compute
+ Jdenticon avatars may use `{realm_uuid}:{user_id}` as the Jdenticon key.
+
+ **Changes**: New in Zulip 12.0 (feature level 466).
realm_available_video_chat_providers:
type: object
description: |
diff --git a/zerver/tests/test_home.py b/zerver/tests/test_home.py
index f8d27e54412..91b94ca8425 100644
--- a/zerver/tests/test_home.py
+++ b/zerver/tests/test_home.py
@@ -226,6 +226,7 @@ class HomeTest(ZulipTestCase):
"realm_user_groups",
"realm_user_settings_defaults",
"realm_users",
+ "realm_uuid",
"realm_video_chat_provider",
"realm_waiting_period_threshold",
"realm_want_advertise_in_communities_directory",