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.

events: Send enter_sends if update_display_settings in fetch_event_types.

Sahil Batra79b0ff5b23eb
diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md
index 775f599a7f0..6e92ea9659c 100644
--- a/templates/zerver/api/changelog.md
+++ b/templates/zerver/api/changelog.md
@@ -11,6 +11,12 @@ below features are supported.
## Changes in Zulip 5.0
+**Feature level 84**
+
+* [`POST /register`](/api/register-queue): The `enter_sends` setting
+ is now sent when `update_display_setting` is present in
+ `fetch_event_types` instead of `realm_user`.
+
**Feature level 83**
* * [`POST /register`](/api/register-queue): The `cross_realm_bots`
diff --git a/version.py b/version.py
index 473d5a5e4f3..46baeeb2657 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 = 83
+API_FEATURE_LEVEL = 84
# 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 9ecb4630b0f..c7c73b83640 100644
--- a/zerver/lib/events.py
+++ b/zerver/lib/events.py
@@ -384,7 +384,6 @@ def fetch_initial_state_data(
state["is_guest"] = settings_user.is_guest
state["is_billing_admin"] = settings_user.is_billing_admin
state["user_id"] = settings_user.id
- state["enter_sends"] = settings_user.enter_sends
state["email"] = settings_user.email
state["delivery_email"] = settings_user.delivery_email
state["full_name"] = settings_user.full_name
@@ -502,10 +501,6 @@ def fetch_initial_state_data(
if want("update_display_settings"):
for prop in UserProfile.property_types:
- if prop == "enter_sends":
- # This will be removed when we make the API change to
- # move this to the update_display_settings event type.
- continue
state[prop] = getattr(settings_user, prop)
state["emojiset_choices"] = UserProfile.emojiset_choices()
state["timezone"] = settings_user.timezone
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 8eadd1eae86..d676b3d71fc 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -9579,10 +9579,14 @@ paths:
enter_sends:
type: boolean
description: |
- Present if `realm_user` is present in `fetch_event_types`.
+ Present if `update_display_settings` is present in `fetch_event_types`.
Whether the user setting for [sending on pressing Enter](/help/enable-enter-to-send)
in the compose box is enabled.
+
+ **Changes**: Prior to Zulip 5.0 (feature level 84) this field was present
+ in response if 'realm_user' was present in `fetch_event_types`, not
+ `update_display_settings`.
user_id:
type: integer
description: |