events: Send enter_sends if update_display_settings in fetch_event_types.

We now send 'enter_sends' in response of '/register' endpoint if
'update_display_settings' is present in 'fetch_event_types' instead
of 'realm_user'.
This commit is contained in:
Sahil Batra
2021-07-27 01:39:17 +05:30
committed by Tim Abbott
parent 355f6e9b53
commit 79b0ff5b23
4 changed files with 12 additions and 7 deletions

View File

@@ -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`

View File

@@ -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

View File

@@ -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

View File

@@ -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: |