mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
register: Send user_settings in response based on client capabilities.
We added "user_settings" object containing all the user settings in previous commit. This commit modifies the code to send the existing setting fields in the top-level object only if user_settings_object client_capabilities field is False.
This commit is contained in:
@@ -25,6 +25,10 @@ below features are supported.
|
|||||||
event queue.
|
event queue.
|
||||||
* [`POST /register`](/api/register-queue): Added `user_settings` field
|
* [`POST /register`](/api/register-queue): Added `user_settings` field
|
||||||
in the response, which is a dictionary containing all the user settings.
|
in the response, which is a dictionary containing all the user settings.
|
||||||
|
* [`POST /register`](/api/register-queue): User's personal settings in
|
||||||
|
the top-level object are included in response only when `user_settings_object`
|
||||||
|
is not included in the `client_capabilities` when registering the event
|
||||||
|
queue.
|
||||||
|
|
||||||
**Feature level 88**
|
**Feature level 88**
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ def fetch_initial_state_data(
|
|||||||
queue_id: Optional[str] = "",
|
queue_id: Optional[str] = "",
|
||||||
client_gravatar: bool = False,
|
client_gravatar: bool = False,
|
||||||
user_avatar_url_field_optional: bool = False,
|
user_avatar_url_field_optional: bool = False,
|
||||||
|
user_settings_object: bool = False,
|
||||||
slim_presence: bool = False,
|
slim_presence: bool = False,
|
||||||
include_subscribers: bool = True,
|
include_subscribers: bool = True,
|
||||||
include_streams: bool = True,
|
include_streams: bool = True,
|
||||||
@@ -513,13 +514,13 @@ def fetch_initial_state_data(
|
|||||||
if want("stop_words"):
|
if want("stop_words"):
|
||||||
state["stop_words"] = read_stop_words()
|
state["stop_words"] = read_stop_words()
|
||||||
|
|
||||||
if want("update_display_settings"):
|
if want("update_display_settings") and not user_settings_object:
|
||||||
for prop in UserProfile.property_types:
|
for prop in UserProfile.property_types:
|
||||||
state[prop] = getattr(settings_user, prop)
|
state[prop] = getattr(settings_user, prop)
|
||||||
state["emojiset_choices"] = UserProfile.emojiset_choices()
|
state["emojiset_choices"] = UserProfile.emojiset_choices()
|
||||||
state["timezone"] = settings_user.timezone
|
state["timezone"] = settings_user.timezone
|
||||||
|
|
||||||
if want("update_global_notifications"):
|
if want("update_global_notifications") and not user_settings_object:
|
||||||
for notification in UserProfile.notification_setting_types:
|
for notification in UserProfile.notification_setting_types:
|
||||||
state[notification] = getattr(settings_user, notification)
|
state[notification] = getattr(settings_user, notification)
|
||||||
state["available_notification_sounds"] = get_available_notification_sounds()
|
state["available_notification_sounds"] = get_available_notification_sounds()
|
||||||
@@ -1276,6 +1277,7 @@ def do_events_register(
|
|||||||
queue_id=queue_id,
|
queue_id=queue_id,
|
||||||
client_gravatar=client_gravatar,
|
client_gravatar=client_gravatar,
|
||||||
user_avatar_url_field_optional=user_avatar_url_field_optional,
|
user_avatar_url_field_optional=user_avatar_url_field_optional,
|
||||||
|
user_settings_object=user_settings_object,
|
||||||
slim_presence=slim_presence,
|
slim_presence=slim_presence,
|
||||||
include_subscribers=include_subscribers,
|
include_subscribers=include_subscribers,
|
||||||
include_streams=include_streams,
|
include_streams=include_streams,
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ def build_page_params_for_home_page_load(
|
|||||||
queue_id=None,
|
queue_id=None,
|
||||||
client_gravatar=False,
|
client_gravatar=False,
|
||||||
user_avatar_url_field_optional=client_capabilities["user_avatar_url_field_optional"],
|
user_avatar_url_field_optional=client_capabilities["user_avatar_url_field_optional"],
|
||||||
|
user_settings_object=client_capabilities["user_settings_object"],
|
||||||
slim_presence=False,
|
slim_presence=False,
|
||||||
include_subscribers=False,
|
include_subscribers=False,
|
||||||
include_streams=False,
|
include_streams=False,
|
||||||
|
|||||||
@@ -9022,7 +9022,10 @@ paths:
|
|||||||
|
|
||||||
A dictionary containing the user's personal settings.
|
A dictionary containing the user's personal settings.
|
||||||
|
|
||||||
**Changes**: New in Zulip 5.0 (feature level 89).
|
**Changes**: New in Zulip 5.0 (feature level 89). Previously,
|
||||||
|
these settings appeared in the top-level object, where they are
|
||||||
|
available for clients without the `user_settings_object` client
|
||||||
|
capability for backwards-compatibility.
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
properties:
|
properties:
|
||||||
twenty_four_hour_time:
|
twenty_four_hour_time:
|
||||||
@@ -9275,222 +9278,379 @@ paths:
|
|||||||
|
|
||||||
**Changes**: Added in Zulip 4.0 (feature level 47).
|
**Changes**: Added in Zulip 4.0 (feature level 47).
|
||||||
enable_desktop_notifications:
|
enable_desktop_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_digest_emails:
|
enable_digest_emails:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_login_emails:
|
enable_login_emails:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_marketing_emails:
|
enable_marketing_emails:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
email_notifications_batching_period_seconds:
|
email_notifications_batching_period_seconds:
|
||||||
|
deprecated: true
|
||||||
type: integer
|
type: integer
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_offline_email_notifications:
|
enable_offline_email_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_offline_push_notifications:
|
enable_offline_push_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_online_push_notifications:
|
enable_online_push_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_sounds:
|
enable_sounds:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_stream_desktop_notifications:
|
enable_stream_desktop_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_stream_email_notifications:
|
enable_stream_email_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_stream_push_notifications:
|
enable_stream_push_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_stream_audible_notifications:
|
enable_stream_audible_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
wildcard_mentions_notify:
|
wildcard_mentions_notify:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
message_content_in_email_notifications:
|
message_content_in_email_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
notification_sound:
|
notification_sound:
|
||||||
|
deprecated: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
pm_content_in_desktop_notifications:
|
pm_content_in_desktop_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
desktop_icon_count_display:
|
desktop_icon_count_display:
|
||||||
|
deprecated: true
|
||||||
type: integer
|
type: integer
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
realm_name_in_notifications:
|
realm_name_in_notifications:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
presence_enabled:
|
presence_enabled:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The current value of this global notification setting for the user.
|
The current value of this global notification setting for the user.
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
available_notification_sounds:
|
available_notification_sounds:
|
||||||
|
deprecated: true
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_global_notifications` is present in `fetch_event_types`.
|
Present if `update_global_notifications` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in their
|
||||||
|
client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Array containing the names of the notification sound options supported by
|
Array containing the names of the notification sound options supported by
|
||||||
this Zulip server. Only relevant to support UI for configuring notification
|
this Zulip server. Only relevant to support UI for configuring notification
|
||||||
sounds.
|
sounds.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
color_scheme:
|
color_scheme:
|
||||||
|
deprecated: true
|
||||||
type: integer
|
type: integer
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The color scheme selected by the user.
|
The color scheme selected by the user.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
default_language:
|
default_language:
|
||||||
|
deprecated: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The default language chosen by the user.
|
The default language chosen by the user.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
demote_inactive_streams:
|
demote_inactive_streams:
|
||||||
|
deprecated: true
|
||||||
type: integer
|
type: integer
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen to demote inactive streams.
|
Whether the user has chosen to demote inactive streams.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
dense_mode:
|
dense_mode:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has switched on dense mode. Dense mode is an experimental
|
Whether the user has switched on dense mode. Dense mode is an experimental
|
||||||
feature that is only available in development environments.
|
feature that is only available in development environments.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
emojiset:
|
emojiset:
|
||||||
|
deprecated: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The name of the emojiset that the user has chosen.
|
The name of the emojiset that the user has chosen.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
enable_drafts_synchronization:
|
enable_drafts_synchronization:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`.
|
||||||
@@ -9501,20 +9661,30 @@ paths:
|
|||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
**Changes**: New in Zulip 5.0 (feature level 87).
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead. New in Zulip 5.0 (feature level 87).
|
||||||
fluid_layout_width:
|
fluid_layout_width:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen for the layout width to be fluid.
|
Whether the user has chosen for the layout width to be fluid.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
default_view:
|
default_view:
|
||||||
|
deprecated: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The [default view](/help/change-default-view) in Zulip, represented
|
The [default view](/help/change-default-view) in Zulip, represented
|
||||||
as the URL suffix after `#` to be rendered when Zulip loads.
|
as the URL suffix after `#` to be rendered when Zulip loads.
|
||||||
@@ -9523,19 +9693,31 @@ paths:
|
|||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
high_contrast_mode:
|
high_contrast_mode:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether has switched on high contrast mode.
|
Whether has switched on high contrast mode.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
left_side_userlist:
|
left_side_userlist:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen for the userlist to be displayed
|
Whether the user has chosen for the userlist to be displayed
|
||||||
on the left side of the screen (for desktop app and web app) in narrow
|
on the left side of the screen (for desktop app and web app) in narrow
|
||||||
@@ -9543,49 +9725,79 @@ paths:
|
|||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
starred_message_counts:
|
starred_message_counts:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen the number of starred messages to
|
Whether the user has chosen the number of starred messages to
|
||||||
be displayed similar to unread counts.
|
be displayed similar to unread counts.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
timezone:
|
timezone:
|
||||||
|
deprecated: true
|
||||||
type: string
|
type: string
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
The timezone configured for the user. This is used primarily to display
|
The timezone configured for the user. This is used primarily to display
|
||||||
the user's timezone to other users.
|
the user's timezone to other users.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
translate_emoticons:
|
translate_emoticons:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen for emoticons to be translated into emoji
|
Whether the user has chosen for emoticons to be translated into emoji
|
||||||
in the Zulip compose box.
|
in the Zulip compose box.
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
twenty_four_hour_time:
|
twenty_four_hour_time:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user has chosen a twenty four hour time display (true)
|
Whether the user has chosen a twenty four hour time display (true)
|
||||||
or a twelve hour one (false).
|
or a twelve hour one (false).
|
||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
emojiset_choices:
|
emojiset_choices:
|
||||||
|
deprecated: true
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Array of dictionaries where each dictionary describes an emojiset
|
Array of dictionaries where each dictionary describes an emojiset
|
||||||
supported by this version of the Zulip server.
|
supported by this version of the Zulip server.
|
||||||
@@ -9595,6 +9807,9 @@ paths:
|
|||||||
|
|
||||||
See [PATCH /settings](/api/update-settings) for details on
|
See [PATCH /settings](/api/update-settings) for details on
|
||||||
the meaning of this setting.
|
the meaning of this setting.
|
||||||
|
|
||||||
|
**Changes**: Deprecated in Zulip 5.0 (feature level 89), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
type: object
|
type: object
|
||||||
@@ -10467,14 +10682,19 @@ paths:
|
|||||||
|
|
||||||
Whether the current user is a [guest user](/help/roles-and-permissions).
|
Whether the current user is a [guest user](/help/roles-and-permissions).
|
||||||
enter_sends:
|
enter_sends:
|
||||||
|
deprecated: true
|
||||||
type: boolean
|
type: boolean
|
||||||
description: |
|
description: |
|
||||||
Present if `update_display_settings` is present in `fetch_event_types`.
|
Present if `update_display_settings` is present in `fetch_event_types`
|
||||||
|
and only for clients that did not include `user_settings_object` in
|
||||||
|
their client_capabilities` when registering the event queue.
|
||||||
|
|
||||||
Whether the user setting for [sending on pressing Enter](/help/enable-enter-to-send)
|
Whether the user setting for [sending on pressing Enter](/help/enable-enter-to-send)
|
||||||
in the compose box is enabled.
|
in the compose box is enabled.
|
||||||
|
|
||||||
**Changes**: Prior to Zulip 5.0 (feature level 84) this field was present
|
**Changes**: Deprecated in Zulip 5.0 (feature level 87), clients should
|
||||||
|
use `user_settings` dictionary instead.
|
||||||
|
Prior to Zulip 5.0 (feature level 84) this field was present
|
||||||
in response if 'realm_user' was present in `fetch_event_types`, not
|
in response if 'realm_user' was present in `fetch_event_types`, not
|
||||||
`update_display_settings`.
|
`update_display_settings`.
|
||||||
user_id:
|
user_id:
|
||||||
|
|||||||
@@ -547,6 +547,32 @@ class FetchInitialStateDataTest(ZulipTestCase):
|
|||||||
else:
|
else:
|
||||||
self.assertFalse("avatar_url" in user_dict)
|
self.assertFalse("avatar_url" in user_dict)
|
||||||
|
|
||||||
|
def test_user_settings_based_on_client_capabilities(self) -> None:
|
||||||
|
hamlet = self.example_user("hamlet")
|
||||||
|
result = fetch_initial_state_data(
|
||||||
|
user_profile=hamlet,
|
||||||
|
user_settings_object=True,
|
||||||
|
)
|
||||||
|
self.assertIn("user_settings", result)
|
||||||
|
for prop in UserProfile.property_types:
|
||||||
|
self.assertNotIn(prop, result)
|
||||||
|
self.assertIn(prop, result["user_settings"])
|
||||||
|
for prop in UserProfile.notification_setting_types:
|
||||||
|
self.assertNotIn(prop, result)
|
||||||
|
self.assertIn(prop, result["user_settings"])
|
||||||
|
|
||||||
|
result = fetch_initial_state_data(
|
||||||
|
user_profile=hamlet,
|
||||||
|
user_settings_object=False,
|
||||||
|
)
|
||||||
|
self.assertIn("user_settings", result)
|
||||||
|
for prop in UserProfile.property_types:
|
||||||
|
self.assertIn(prop, result)
|
||||||
|
self.assertIn(prop, result["user_settings"])
|
||||||
|
for prop in UserProfile.notification_setting_types:
|
||||||
|
self.assertIn(prop, result)
|
||||||
|
self.assertIn(prop, result["user_settings"])
|
||||||
|
|
||||||
|
|
||||||
class ClientDescriptorsTest(ZulipTestCase):
|
class ClientDescriptorsTest(ZulipTestCase):
|
||||||
def test_get_client_info_for_all_public_streams(self) -> None:
|
def test_get_client_info_for_all_public_streams(self) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user