zulip_api/message/realm_user_settings_default.rs
1use serde::{Deserialize, Serialize};
2use serde_repr::{Deserialize_repr, Serialize_repr};
3
4use crate::{field_access, impl_default, impl_display, UserSettingsEmojisetChoice};
5
6/// Represents the default values of settings for new users.
7///
8/// **Changes**: New in Zulip 5.0 (feature level 95).
9///
10/// Modified from `openapi-generator-cli` output:
11///
12/// ```shell,no_build,no_run
13/// $ openapi-generator-cli generate -g rust -i ./zerver/openapi/zulip.yaml -o zulip-openapi --skip-validate-spec
14/// ```
15///
16/// ```text
17/// /*
18/// * Zulip REST API
19/// *
20/// * Powerful open source group chat
21/// *
22/// * The version of the OpenAPI document: 1.0.0
23/// *
24/// * Generated by: https://openapi-generator.tech
25/// */
26/// ```
27///
28/// See [zerver/openapi/zulip.yaml](https://github.com/zulip/zulip/blob/main/zerver/openapi/zulip.yaml) for the original OpenAPI configuration.
29///
30/// Configuration slightly modified to work with the Rust generator of [`openapi-generator-cli`](https://openapi-generator.tech).
31///
32#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
33pub struct RealmUserSettingsDefault {
34 #[serde(skip_serializing_if = "Option::is_none")]
35 twenty_four_hour_time: Option<bool>,
36 #[serde(skip_serializing_if = "Option::is_none")]
37 web_mark_read_on_scroll_policy: Option<WebMarkReadOnScrollPolicy>,
38 #[serde(skip_serializing_if = "Option::is_none")]
39 web_channel_default_view: Option<WebChannelDefaultView>,
40 #[serde(skip_serializing_if = "Option::is_none")]
41 starred_message_counts: Option<bool>,
42 #[serde(skip_serializing_if = "Option::is_none")]
43 receives_typing_notifications: Option<bool>,
44 #[serde(skip_serializing_if = "Option::is_none")]
45 web_suggest_update_timezone: Option<bool>,
46 #[serde(skip_serializing_if = "Option::is_none")]
47 fluid_layout_width: Option<bool>,
48 #[serde(skip_serializing_if = "Option::is_none")]
49 high_contrast_mode: Option<bool>,
50 #[serde(skip_serializing_if = "Option::is_none")]
51 web_font_size_px: Option<u64>,
52 #[serde(skip_serializing_if = "Option::is_none")]
53 web_line_height_percent: Option<u64>,
54 #[serde(skip_serializing_if = "Option::is_none")]
55 color_scheme: Option<ColorScheme>,
56 #[serde(skip_serializing_if = "Option::is_none")]
57 translate_emoticons: Option<bool>,
58 #[serde(skip_serializing_if = "Option::is_none")]
59 display_emoji_reaction_users: Option<bool>,
60 #[serde(skip_serializing_if = "Option::is_none")]
61 default_language: Option<String>,
62 #[serde(skip_serializing_if = "Option::is_none")]
63 web_home_view: Option<WebHomeView>,
64 #[serde(skip_serializing_if = "Option::is_none")]
65 web_escape_navigates_to_home_view: Option<bool>,
66 #[serde(skip_serializing_if = "Option::is_none")]
67 left_side_userlist: Option<bool>,
68 #[serde(skip_serializing_if = "Option::is_none")]
69 emojiset: Option<Emojiset>,
70 #[serde(skip_serializing_if = "Option::is_none")]
71 demote_inactive_streams: Option<DemoteInactiveStreams>,
72 #[serde(skip_serializing_if = "Option::is_none")]
73 user_list_style: Option<UserListStyle>,
74 #[serde(skip_serializing_if = "Option::is_none")]
75 web_animate_image_previews: Option<WebAnimateImagePreviews>,
76 #[serde(skip_serializing_if = "Option::is_none")]
77 web_stream_unreads_count_display_policy: Option<WebStreamUnreadsCountDisplayPolicy>,
78 #[serde(skip_serializing_if = "Option::is_none")]
79 hide_ai_features: Option<bool>,
80 #[serde(skip_serializing_if = "Option::is_none")]
81 web_left_sidebar_show_channel_folders: Option<bool>,
82 #[serde(skip_serializing_if = "Option::is_none")]
83 web_left_sidebar_unreads_count_summary: Option<bool>,
84 #[serde(skip_serializing_if = "Option::is_none")]
85 enable_stream_desktop_notifications: Option<bool>,
86 #[serde(skip_serializing_if = "Option::is_none")]
87 enable_stream_email_notifications: Option<bool>,
88 #[serde(skip_serializing_if = "Option::is_none")]
89 enable_stream_push_notifications: Option<bool>,
90 #[serde(skip_serializing_if = "Option::is_none")]
91 enable_stream_audible_notifications: Option<bool>,
92 #[serde(skip_serializing_if = "Option::is_none")]
93 notification_sound: Option<String>,
94 #[serde(skip_serializing_if = "Option::is_none")]
95 enable_desktop_notifications: Option<bool>,
96 #[serde(skip_serializing_if = "Option::is_none")]
97 enable_sounds: Option<bool>,
98 #[serde(skip_serializing_if = "Option::is_none")]
99 enable_offline_email_notifications: Option<bool>,
100 #[serde(skip_serializing_if = "Option::is_none")]
101 enable_offline_push_notifications: Option<bool>,
102 #[serde(skip_serializing_if = "Option::is_none")]
103 enable_online_push_notifications: Option<bool>,
104 #[serde(skip_serializing_if = "Option::is_none")]
105 enable_followed_topic_desktop_notifications: Option<bool>,
106 #[serde(skip_serializing_if = "Option::is_none")]
107 enable_followed_topic_email_notifications: Option<bool>,
108 #[serde(skip_serializing_if = "Option::is_none")]
109 enable_followed_topic_push_notifications: Option<bool>,
110 #[serde(skip_serializing_if = "Option::is_none")]
111 enable_followed_topic_audible_notifications: Option<bool>,
112 #[serde(skip_serializing_if = "Option::is_none")]
113 enable_digest_emails: Option<bool>,
114 #[serde(skip_serializing_if = "Option::is_none")]
115 enable_marketing_emails: Option<bool>,
116 #[serde(skip_serializing_if = "Option::is_none")]
117 enable_login_emails: Option<bool>,
118 #[serde(skip_serializing_if = "Option::is_none")]
119 message_content_in_email_notifications: Option<bool>,
120 #[serde(skip_serializing_if = "Option::is_none")]
121 pm_content_in_desktop_notifications: Option<bool>,
122 #[serde(skip_serializing_if = "Option::is_none")]
123 wildcard_mentions_notify: Option<bool>,
124 #[serde(skip_serializing_if = "Option::is_none")]
125 enable_followed_topic_wildcard_mentions_notify: Option<bool>,
126 #[serde(skip_serializing_if = "Option::is_none")]
127 desktop_icon_count_display: Option<DesktopIconCountDisplay>,
128 #[serde(skip_serializing_if = "Option::is_none")]
129 realm_name_in_email_notifications_policy: Option<RealmNameInEmailNotificationsPolicy>,
130 #[serde(skip_serializing_if = "Option::is_none")]
131 automatically_follow_topics_policy: Option<AutomaticallyFollowTopicsPolicy>,
132 #[serde(skip_serializing_if = "Option::is_none")]
133 automatically_unmute_topics_in_muted_streams_policy:
134 Option<AutomaticallyUnmuteTopicsInMutedStreamsPolicy>,
135 #[serde(skip_serializing_if = "Option::is_none")]
136 automatically_follow_topics_where_mentioned: Option<bool>,
137 #[serde(skip_serializing_if = "Option::is_none")]
138 resolved_topic_notice_auto_read_policy: Option<ResolvedTopicNoticeAutoReadPolicy>,
139 #[serde(skip_serializing_if = "Option::is_none")]
140 presence_enabled: Option<bool>,
141 #[serde(skip_serializing_if = "Option::is_none")]
142 enter_sends: Option<bool>,
143 #[serde(skip_serializing_if = "Option::is_none")]
144 enable_drafts_synchronization: Option<bool>,
145 #[serde(skip_serializing_if = "Option::is_none")]
146 email_notifications_batching_period_seconds: Option<u64>,
147 #[serde(skip_serializing_if = "Option::is_none")]
148 available_notification_sounds: Option<Vec<String>>,
149 #[serde(skip_serializing_if = "Option::is_none")]
150 emojiset_choices: Option<Vec<UserSettingsEmojisetChoice>>,
151 #[serde(skip_serializing_if = "Option::is_none")]
152 send_private_typing_notifications: Option<bool>,
153 #[serde(skip_serializing_if = "Option::is_none")]
154 send_stream_typing_notifications: Option<bool>,
155 #[serde(skip_serializing_if = "Option::is_none")]
156 send_read_receipts: Option<bool>,
157 #[serde(skip_serializing_if = "Option::is_none")]
158 allow_private_data_export: Option<bool>,
159 #[serde(skip_serializing_if = "Option::is_none")]
160 email_address_visibility: Option<EmailAddressVisibility>,
161 #[serde(skip_serializing_if = "Option::is_none")]
162 web_navigate_to_sent_message: Option<bool>,
163}
164
165impl RealmUserSettingsDefault {
166 /// Creates a new [RealmUserSettingsDefault].
167 pub const fn new() -> Self {
168 Self {
169 twenty_four_hour_time: None,
170 web_mark_read_on_scroll_policy: None,
171 web_channel_default_view: None,
172 starred_message_counts: None,
173 receives_typing_notifications: None,
174 web_suggest_update_timezone: None,
175 fluid_layout_width: None,
176 high_contrast_mode: None,
177 web_font_size_px: None,
178 web_line_height_percent: None,
179 color_scheme: None,
180 translate_emoticons: None,
181 display_emoji_reaction_users: None,
182 default_language: None,
183 web_home_view: None,
184 web_escape_navigates_to_home_view: None,
185 left_side_userlist: None,
186 emojiset: None,
187 demote_inactive_streams: None,
188 user_list_style: None,
189 web_animate_image_previews: None,
190 web_stream_unreads_count_display_policy: None,
191 hide_ai_features: None,
192 web_left_sidebar_show_channel_folders: None,
193 web_left_sidebar_unreads_count_summary: None,
194 enable_stream_desktop_notifications: None,
195 enable_stream_email_notifications: None,
196 enable_stream_push_notifications: None,
197 enable_stream_audible_notifications: None,
198 notification_sound: None,
199 enable_desktop_notifications: None,
200 enable_sounds: None,
201 enable_offline_email_notifications: None,
202 enable_offline_push_notifications: None,
203 enable_online_push_notifications: None,
204 enable_followed_topic_desktop_notifications: None,
205 enable_followed_topic_email_notifications: None,
206 enable_followed_topic_push_notifications: None,
207 enable_followed_topic_audible_notifications: None,
208 enable_digest_emails: None,
209 enable_marketing_emails: None,
210 enable_login_emails: None,
211 message_content_in_email_notifications: None,
212 pm_content_in_desktop_notifications: None,
213 wildcard_mentions_notify: None,
214 enable_followed_topic_wildcard_mentions_notify: None,
215 desktop_icon_count_display: None,
216 realm_name_in_email_notifications_policy: None,
217 automatically_follow_topics_policy: None,
218 automatically_unmute_topics_in_muted_streams_policy: None,
219 automatically_follow_topics_where_mentioned: None,
220 resolved_topic_notice_auto_read_policy: None,
221 presence_enabled: None,
222 enter_sends: None,
223 enable_drafts_synchronization: None,
224 email_notifications_batching_period_seconds: None,
225 available_notification_sounds: None,
226 emojiset_choices: None,
227 send_private_typing_notifications: None,
228 send_stream_typing_notifications: None,
229 send_read_receipts: None,
230 allow_private_data_export: None,
231 email_address_visibility: None,
232 web_navigate_to_sent_message: None,
233 }
234 }
235}
236
237field_access! {
238 RealmUserSettingsDefault {
239 /// Whether time should be [displayed in 24-hour notation](https://zulip.com/help/change-the-time-format).
240 ///
241 /// A `null` value indicates that the client should use the default time format for the user's locale.
242 ///
243 /// **Changes**: Prior to Zulip 11.0 (feature level 408), `null` was not a valid value for this setting.
244 /// Note that it was not possible to actually set the time format to `null` at this feature level.
245 ///
246 /// New in Zulip 5.0 (feature level 99). This value was previously available as `realm_default_twenty_four_hour_time`
247 /// in the top-level response object (only when `realm` was present in `fetch_event_types`).
248 twenty_four_hour_time: option { bool },
249 /// Whether or not to mark messages as read when the user scrolls through their feed.
250 web_mark_read_on_scroll_policy: option { WebMarkReadOnScrollPolicy },
251 /// Web/desktop app setting controlling the default navigation behavior when clicking on a channel link.
252 web_channel_default_view: option { WebChannelDefaultView },
253 /// Whether clients should display the [number of starred messages](https://zulip.com/help/star-a-message#display-the-number-of-starred-messages).
254 starred_message_counts: option { bool },
255 /// Whether the user is configured to receive typing notifications from other users.
256 ///
257 /// The server will only deliver typing notifications events to users who for whom this is enabled.
258 ///
259 /// **Changes**: New in Zulip 9.0 (feature level 253). Previously, there were only options to disable sending typing notifications.
260 receives_typing_notifications: option { bool },
261 /// Whether the user should be shown an alert, offering to update their [profile time zone](https://zulip.com/help/change-your-timezone),
262 /// when the time displayed for the profile time zone differs from the current time displayed by the time zone configured on their device.
263 ///
264 /// **Changes**: New in Zulip 10.0 (feature level 329).
265 web_suggest_update_timezone: option { bool },
266 /// Whether to use the [maximum available screen width](https://zulip.com/help/enable-full-width-display) for the web app's center panel (message feed, recent conversations) on wide screens.
267 fluid_layout_width: option { bool },
268 /// This setting is reserved for use to control variations in Zulip's design to help visually impaired users.
269 high_contrast_mode: option { bool },
270 /// User-configured primary `font-size` for the web application, in pixels.
271 ///
272 /// **Changes**: New in Zulip 9.0 (feature level 245). Previously, font size was only adjustable via browser zoom. Note that this setting was not fully implemented at this feature level.
273 web_font_size_px: option { u64 },
274 /// User-configured primary `line-height` for the web application, in percent, so a value of 120 represents a `line-height` of 1.2.
275 ///
276 /// **Changes**: New in Zulip 9.0 (feature level 245). Previously, line height was not user-configurable. Note that this setting was not fully implemented at this feature level.
277 web_line_height_percent: option { u64 },
278 /// Controls which [color theme](https://zulip.com/help/dark-theme) to use.
279 color_scheme: option { ColorScheme },
280 /// Whether to [translate emoticons to emoji](/help/configure-emoticon-translations) in messages the user sends.
281 translate_emoticons: option { bool },
282 /// Whether to display the names of reacting users on a message.
283 ///
284 /// When enabled, clients should display the names of reacting users, rather than a count, for messages with few total reactions.
285 /// The ideal cutoff may depend on the space available for displaying reactions;
286 /// the official web application displays names when 3 or fewer total reactions are present with this setting enabled.
287 ///
288 /// **Changes**: New in Zulip 6.0 (feature level 125).
289 display_emoji_reaction_users: option { bool },
290 /// The [home view](/help/configure-home-view) used when opening a new Zulip web app window or hitting the `Esc` keyboard shortcut repeatedly.
291 web_home_view: option { WebHomeView },
292 /// Whether the escape key navigates to the [configured home view](/help/configure-home-view).
293 ///
294 /// **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was called `escape_navigates_to_default_view`, which was new in Zulip 5.0 (feature level 107).
295 web_escape_navigates_to_home_view: option { bool },
296 /// Whether the users list on left sidebar in narrow windows.
297 ///
298 /// This feature is not heavily used and is likely to be reworked.
299 left_side_userlist: option { bool },
300 /// The user's configured [emoji set](https://zulip.com/help/emoji-and-emoticons#use-emoticons), used to display emoji to the user everywhere they appear in the UI.
301 emojiset: option { Emojiset },
302 /// Whether to [hide inactive channels](https://zulip.com/help/manage-inactive-channels) in the left sidebar.
303 demote_inactive_streams: option { DemoteInactiveStreams },
304 /// The style selected by the user for the right sidebar user list.
305 user_list_style: option { UserListStyle },
306 /// Controls how animated images should be played in the message feed in the web/desktop application.
307 web_animate_image_previews: option { WebAnimateImagePreviews },
308 /// Configuration for which channels should be displayed with a numeric unread count in the left sidebar.
309 ///
310 /// Channels that do not have an unread count will have a simple dot indicator for whether there are any unread messages.
311 web_stream_unreads_count_display_policy: option { WebStreamUnreadsCountDisplayPolicy },
312 /// Controls whether user wants AI features like topic summarization to be hidden in all Zulip clients. **Changes**: New in Zulip 10.0 (feature level 350).
313 hide_ai_features: option { bool },
314 /// Determines whether the web/desktop application's left sidebar displays any channel folders configured by the organization. **Changes**: New in Zulip 11.0 (feature level 411).
315 web_left_sidebar_show_channel_folders: option { bool },
316 /// Determines whether the web/desktop application's left sidebar displays the unread message count summary. **Changes**: New in Zulip 11.0 (feature level 398).
317 web_left_sidebar_unreads_count_summary: option { bool },
318 /// Enable visual desktop notifications for channel messages.
319 enable_stream_desktop_notifications: option { bool },
320 /// Enable email notifications for channel messages.
321 enable_stream_email_notifications: option { bool },
322 /// Enable mobile notifications for channel messages.
323 enable_stream_push_notifications: option { bool },
324 /// Enable audible desktop notifications for channel messages.
325 enable_stream_audible_notifications: option { bool },
326 /// Enable visual desktop notifications for direct messages and @-mentions.
327 enable_desktop_notifications: option { bool },
328 /// Enable audible desktop notifications for direct messages and @-mentions.
329 enable_sounds: option { bool },
330 /// Enable email notifications for direct messages and @-mentions received when the user is offline.
331 enable_offline_email_notifications: option { bool },
332 /// Enable mobile notification for direct messages and @-mentions received when the user is offline.
333 enable_offline_push_notifications: option { bool },
334 /// Enable mobile notification for direct messages and @-mentions received when the user is online.
335 enable_online_push_notifications: option { bool },
336 /// Enable visual desktop notifications for messages sent to followed topics.
337 ///
338 /// **Changes**: New in Zulip 8.0 (feature level 189).
339 enable_followed_topic_desktop_notifications: option { bool },
340 /// Enable email notifications for messages sent to followed topics.
341 ///
342 /// **Changes**: New in Zulip 8.0 (feature level 189).
343 enable_followed_topic_email_notifications: option { bool },
344 /// Enable push notifications for messages sent to followed topics.
345 ///
346 /// **Changes**: New in Zulip 8.0 (feature level 189).
347 enable_followed_topic_push_notifications: option { bool },
348 /// Enable audible desktop notifications for messages sent to followed topics.
349 ///
350 /// **Changes**: New in Zulip 8.0 (feature level 189).
351 enable_followed_topic_audible_notifications: option { bool },
352 /// Enable digest emails when the user is away.
353 enable_digest_emails: option { bool },
354 /// Enable marketing emails. Has no function outside Zulip Cloud.
355 enable_marketing_emails: option { bool },
356 /// Enable email notifications for new logins to account.
357 enable_login_emails: option { bool },
358 /// Include the message's content in email notifications for new messages.
359 message_content_in_email_notifications: option { bool },
360 /// Include content of direct messages in desktop notifications.
361 pm_content_in_desktop_notifications: option { bool },
362 /// Whether wildcard mentions (E.g. @**all**) should send notifications like a personal mention.
363 wildcard_mentions_notify: option { bool },
364 /// Whether wildcard mentions (e.g., @**all**) in messages sent to followed topics should send notifications like a personal mention.
365 ///
366 /// **Changes**: New in Zulip 8.0 (feature level 189).
367 enable_followed_topic_wildcard_mentions_notify: option { bool },
368 /// Unread count badge (appears in desktop sidebar and browser tab).
369 desktop_icon_count_display: option { DesktopIconCountDisplay },
370 /// Whether to [include organization name in subject of message notification emails](https://zulip.com/help/email-notifications#include-organization-name-in-subject-line).
371 realm_name_in_email_notifications_policy: option { RealmNameInEmailNotificationsPolicy },
372 /// Which [topics to follow automatically](/help/mute-a-topic).
373 automatically_follow_topics_policy: option { AutomaticallyFollowTopicsPolicy },
374 /// Which [topics to unmute automatically in muted channels](/help/mute-a-topic).
375 automatically_unmute_topics_in_muted_streams_policy: option { AutomaticallyUnmuteTopicsInMutedStreamsPolicy },
376 /// Whether the server will automatically mark the user as following topics where the user is mentioned.
377 ///
378 /// **Changes**: New in Zulip 8.0 (feature level 235).
379 automatically_follow_topics_where_mentioned: option { bool },
380 /// Controls whether the resolved-topic notices are marked as read.
381 resolved_topic_notice_auto_read_policy: option { ResolvedTopicNoticeAutoReadPolicy },
382 /// Display the presence status to other users when online.
383 presence_enabled: option { bool },
384 /// Whether the user setting for [sending on pressing Enter](/help/configure-send-message-keys) in the compose box is enabled.
385 enter_sends: option { bool },
386 /// A boolean parameter to control whether synchronizing drafts is enabled for the user.
387 ///
388 /// When synchronization is disabled, all drafts stored in the server will be automatically deleted from the server.
389 ///
390 /// This does not do anything (like sending events) to delete local copies of drafts stored in clients.
391 enable_drafts_synchronization: option { bool },
392 /// The duration (in seconds) for which the server should wait to batch email notifications before sending them.
393 email_notifications_batching_period_seconds: option { u64 },
394 /// Whether [typing notifications](/help/typing-notifications) be sent when composing direct messages.
395 ///
396 /// **Changes**: New in Zulip 5.0 (feature level 105).
397 send_private_typing_notifications: option { bool },
398 /// Whether [typing notifications](/help/typing-notifications) be sent when composing channel messages.
399 ///
400 /// **Changes**: New in Zulip 5.0 (feature level 105).
401 send_stream_typing_notifications: option { bool },
402 /// Whether other users are allowed to see whether you've read messages.
403 ///
404 /// **Changes**: New in Zulip 5.0 (feature level 105).
405 send_read_receipts: option { bool },
406 /// Whether organization administrators are allowed to export your private data.
407 ///
408 /// **Changes**: New in Zulip 10.0 (feature level 293).
409 allow_private_data_export: option { bool },
410 /// The [policy][permission-level] for [which other users][help-email-visibility] in this organization can see the user's real email address.
411 email_address_visibility: option { EmailAddressVisibility },
412 /// Web/desktop app setting for whether the user's view should automatically go to the conversation where they sent a message.
413 ///
414 /// **Changes**: New in Zulip 9.0 (feature level 268). Previously, this behavior was not configurable.
415 web_navigate_to_sent_message: option { bool },
416 }
417}
418
419field_access! {
420 RealmUserSettingsDefault {
421 /// What [default language](https://zulip.com/help/change-your-language) to use for the account.
422 ///
423 /// This controls both the Zulip UI as well as email notifications sent to the user.
424 ///
425 /// The value needs to be a standard language code that the Zulip server has translation data for; for example, `\"en\"` for English or `\"de\"` for German.
426 default_language: option_cow_deref { str, String },
427 /// Notification sound name.
428 notification_sound: option_cow_deref { str, String },
429 /// Array containing the names of the notification sound options supported by this Zulip server.
430 ///
431 /// Only relevant to support UI for configuring notification sounds.
432 available_notification_sounds: option_cow_deref { [String], Vec<String> },
433 /// Array of dictionaries where each dictionary describes an emoji set supported by this version of the Zulip server.
434 ///
435 /// Only relevant to clients with configuration UI for choosing an emoji set; the currently selected emoji set is available in the `emojiset` key.
436 ///
437 /// See [PATCH /settings](https://zulip.com/api/update-settings) for details on the meaning of this setting.
438 emojiset_choices: option_cow_deref { [UserSettingsEmojisetChoice], Vec<UserSettingsEmojisetChoice> },
439 }
440}
441
442impl_default!(RealmUserSettingsDefault);
443impl_display!(RealmUserSettingsDefault);
444
445/// Whether or not to mark messages as read when the user scrolls through their feed.
446///
447/// - 1: Always
448/// - 2: Only in conversation views
449/// - 3: Never
450///
451/// **Changes**: New in Zulip 7.0 (feature level 175).
452/// Previously, there was no way for the user to configure this behavior on the web,
453/// and the Zulip web and desktop apps behaved like the \"Always\" setting when marking messages as read.
454#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
455#[repr(u8)]
456pub enum WebMarkReadOnScrollPolicy {
457 Always = 1,
458 OnlyInConversationViews = 2,
459 Never = 3,
460}
461
462impl WebMarkReadOnScrollPolicy {
463 /// Creates a new [WebMarkReadOnScrollPolicy].
464 pub const fn new() -> Self {
465 Self::Always
466 }
467}
468
469impl_default!(WebMarkReadOnScrollPolicy);
470impl_display!(WebMarkReadOnScrollPolicy);
471
472/// Web/desktop app setting controlling the default navigation behavior when clicking on a channel link.
473///
474/// - 1: Top topic in the channel
475/// - 2: Channel feed
476/// - 3: List of topics
477/// - 4: Top unread topic in channel
478///
479/// **Changes**: The \"Top unread topic in channel\" is new in Zulip 11.0 (feature level 401).
480///
481/// In Zulip 11.0 (feature level 383), we added a new option \"List of topics\" to this setting.
482///
483/// New in Zulip 9.0 (feature level 269). Previously, this was not configurable, and every user had the \"Channel feed\" behavior.
484#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
485#[repr(u8)]
486pub enum WebChannelDefaultView {
487 TopTopic = 1,
488 ChannelFeed = 2,
489 ListOfTopics = 3,
490 TopUnreadTopic = 4,
491}
492
493impl WebChannelDefaultView {
494 /// Creates a new [WebChannelDefaultView].
495 pub const fn new() -> Self {
496 Self::TopTopic
497 }
498}
499
500impl_default!(WebChannelDefaultView);
501impl_display!(WebChannelDefaultView);
502
503/// Controls which [color theme](/help/dark-theme) to use.
504///
505/// - 1: Automatic
506/// - 2: Dark theme
507/// - 3: Light theme
508///
509/// Automatic detection is implementing using the standard `prefers-color-scheme` media query.
510#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
511#[repr(u8)]
512pub enum ColorScheme {
513 Automatic = 1,
514 DarkTheme = 2,
515 LightTheme = 3,
516}
517
518impl ColorScheme {
519 /// Creates a new [ColorScheme].
520 pub const fn new() -> Self {
521 Self::Automatic
522 }
523}
524
525impl_default!(ColorScheme);
526impl_display!(ColorScheme);
527
528/// Represents the `home view` used when opening a new Zulip web app window or hitting the `Esc` keyboard shortcut repeatedly.
529///
530/// - \"recent\" - Recent conversations view
531/// - \"inbox\" - Inbox view
532/// - \"all_messages\" - Combined feed view
533///
534/// **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was called `default_view`, which was new in Zulip 4.0 (feature level 42).
535#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
536#[serde(rename_all = "snake_case")]
537pub enum WebHomeView {
538 Recent,
539 Inbox,
540 AllMessages,
541}
542
543impl WebHomeView {
544 /// Creates a new [WebHomeView].
545 pub const fn new() -> Self {
546 Self::Recent
547 }
548}
549
550impl_default!(WebHomeView);
551impl_display!(WebHomeView);
552
553/// Represents The user's configured `emoji set`, used to display emoji to the user everywhere they appear in the UI.
554///
555/// - \"google\": Google modern
556/// - \"twitter\": Twitter
557/// - \"text\": Plain text
558#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
559#[serde(rename_all = "snake_case")]
560pub enum Emojiset {
561 Google,
562 Twitter,
563 Text,
564}
565
566impl Emojiset {
567 /// Creates a new [Emojiset].
568 pub const fn new() -> Self {
569 Self::Google
570 }
571}
572
573impl_default!(Emojiset);
574impl_display!(Emojiset);
575
576/// Whether to `hide inactive channels` in the left sidebar.
577///
578/// - 1: Automatic
579/// - 2: Always
580/// - 3: Never
581#[repr(u8)]
582#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
583pub enum DemoteInactiveStreams {
584 Automatic = 1,
585 Always = 2,
586 Never = 3,
587}
588
589impl DemoteInactiveStreams {
590 /// Creates a new [DemoteInactiveStreams].
591 pub const fn new() -> Self {
592 Self::Automatic
593 }
594}
595
596impl_default!(DemoteInactiveStreams);
597impl_display!(DemoteInactiveStreams);
598
599/// The style selected by the user for the right sidebar user list.
600///
601/// - 1: Compact
602/// - 2: With status
603/// - 3: With avatar and status
604///
605/// **Changes**: New in Zulip 6.0 (feature level 141).
606#[repr(u8)]
607#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
608pub enum UserListStyle {
609 Compact = 1,
610 WithStatus = 2,
611 WithAvatarAndStatus = 3,
612}
613
614impl UserListStyle {
615 /// Creates a new [UserListStyle].
616 pub const fn new() -> Self {
617 Self::Compact
618 }
619}
620
621impl_default!(UserListStyle);
622impl_display!(UserListStyle);
623
624/// Controls how animated images should be played in the message feed in the web/desktop application.
625///
626/// - \"always\": Always play the animated images in the message feed.
627/// - \"on_hover\": Play the animated images on hover over them in the message feed.
628/// - \"never\": Never play animated images in the message feed.
629///
630/// **Changes**: New in Zulip 9.0 (feature level 275).
631#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
632#[serde(rename_all = "snake_case")]
633pub enum WebAnimateImagePreviews {
634 Always,
635 OnHover,
636 Never,
637}
638
639impl WebAnimateImagePreviews {
640 /// Creates a new [WebAnimateImagePreviews].
641 pub const fn new() -> Self {
642 Self::Always
643 }
644}
645
646impl_default!(WebAnimateImagePreviews);
647impl_display!(WebAnimateImagePreviews);
648
649/// Configuration for which channels should be displayed with a numeric unread count in the left sidebar.
650///
651/// Channels that do not have an unread count will have a simple dot indicator for whether there are any unread messages.
652///
653/// - 1: All channels
654/// - 2: Unmuted channels and topics
655/// - 3: No channels
656///
657/// **Changes**: New in Zulip 8.0 (feature level 210).
658#[repr(u8)]
659#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
660pub enum WebStreamUnreadsCountDisplayPolicy {
661 AllChannels = 1,
662 UnmutedChannelsAndTopics = 2,
663 NoChannels = 3,
664}
665
666impl WebStreamUnreadsCountDisplayPolicy {
667 /// Creates a new [WebStreamUnreadsCountDisplayPolicy].
668 pub const fn new() -> Self {
669 Self::AllChannels
670 }
671}
672
673impl_default!(WebStreamUnreadsCountDisplayPolicy);
674impl_display!(WebStreamUnreadsCountDisplayPolicy);
675
676/// Unread count badge (appears in desktop sidebar and browser tab).
677///
678/// - 1: All unread messages
679/// - 2: DMs, mentions, and followed topics
680/// - 3: DMs and mentions
681/// - 4: None
682///
683/// **Changes**: In Zulip 8.0 (feature level 227), added `DMs, mentions, and followed topics` option, renumbering the options to insert it in order.
684#[repr(u8)]
685#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
686pub enum DesktopIconCountDisplay {
687 AllUnreadMessages = 1,
688 DmsMentionsFollowedTopics = 2,
689 DmsMentions = 3,
690 None = 4,
691}
692
693impl DesktopIconCountDisplay {
694 /// Creates a new [DesktopIconCountDisplay].
695 pub const fn new() -> Self {
696 Self::AllUnreadMessages
697 }
698}
699
700impl_default!(DesktopIconCountDisplay);
701impl_display!(DesktopIconCountDisplay);
702
703/// Whether to `include organization name in subject of message notification emails`.
704///
705/// - 1: Automatic
706/// - 2: Always
707/// - 3: Never
708///
709/// **Changes**: New in Zulip 7.0 (feature level 168), replacing the previous `realm_name_in_notifications` boolean; `true` corresponded to `Always`, and `false` to `Never`.
710#[repr(u8)]
711#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
712pub enum RealmNameInEmailNotificationsPolicy {
713 Automatic = 1,
714 Always = 2,
715 Never = 3,
716}
717
718impl RealmNameInEmailNotificationsPolicy {
719 /// Creates a new [RealmNameInEmailNotificationsPolicy].
720 pub const fn new() -> Self {
721 Self::Automatic
722 }
723}
724
725impl_default!(RealmNameInEmailNotificationsPolicy);
726impl_display!(RealmNameInEmailNotificationsPolicy);
727
728/// Which `topics to follow automatically`.
729///
730/// - 1: Topics the user participates in
731/// - 2: Topics the user sends a message to
732/// - 3: Topics the user starts
733/// - 4: Never
734///
735/// **Changes**: New in Zulip 8.0 (feature level 214).
736#[repr(u8)]
737#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
738pub enum AutomaticallyFollowTopicsPolicy {
739 Participates = 1,
740 SendMessages = 2,
741 Starts = 3,
742 Never = 4,
743}
744
745impl AutomaticallyFollowTopicsPolicy {
746 /// Creates a new [AutomaticallyFollowTopicsPolicy].
747 pub const fn new() -> Self {
748 Self::Participates
749 }
750}
751
752impl_default!(AutomaticallyFollowTopicsPolicy);
753impl_display!(AutomaticallyFollowTopicsPolicy);
754
755/// Which `topics to unmute automatically in muted channels`.
756///
757/// - 1: Topics the user participates in
758/// - 2: Topics the user sends a message to
759/// - 3: Topics the user starts
760/// - 4: Never
761///
762/// **Changes**: New in Zulip 8.0 (feature level 214).
763#[repr(u8)]
764#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
765pub enum AutomaticallyUnmuteTopicsInMutedStreamsPolicy {
766 Participates = 1,
767 SendMessages = 2,
768 Starts = 3,
769 Never = 4,
770}
771
772impl AutomaticallyUnmuteTopicsInMutedStreamsPolicy {
773 /// Creates a new [AutomaticallyUnmuteTopicsInMutedStreamsPolicy].
774 pub const fn new() -> Self {
775 Self::Participates
776 }
777}
778
779impl_default!(AutomaticallyUnmuteTopicsInMutedStreamsPolicy);
780impl_display!(AutomaticallyUnmuteTopicsInMutedStreamsPolicy);
781
782/// Controls whether the resolved-topic notices are marked as read.
783///
784/// - \"always\": Always mark resolved-topic notices as read.
785/// - \"except_followed\": Mark resolved-topic notices as read in topics not followed by the user.
786/// - \"never\": Never mark resolved-topic notices as read.
787///
788/// **Changes**: New in Zulip 11.0 (feature level 385).
789#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize, Serialize)]
790#[serde(rename_all = "snake_case")]
791pub enum ResolvedTopicNoticeAutoReadPolicy {
792 Always,
793 ExceptFollowed,
794 Never,
795}
796
797impl ResolvedTopicNoticeAutoReadPolicy {
798 /// Creates a new [ResolvedTopicNoticeAutoReadPolicy].
799 pub const fn new() -> Self {
800 Self::Always
801 }
802}
803
804impl_default!(ResolvedTopicNoticeAutoReadPolicy);
805impl_display!(ResolvedTopicNoticeAutoReadPolicy);
806
807/// The [policy](https://zulip.com/api/roles-and-permissions#permission-levels) for [which other users](https://zulip.com/help/configure-email-visibility) in this organization can see the user's real email address.
808///
809/// - 1: Everyone
810/// - 2: Members only
811/// - 3: Administrators only
812/// - 4: Nobody
813/// - 5: Moderators only
814///
815/// **Changes**: New in Zulip 7.0 (feature level 163), replacing the realm-level setting.
816#[repr(u8)]
817#[derive(Clone, Copy, Debug, Eq, PartialEq, Deserialize_repr, Serialize_repr)]
818pub enum EmailAddressVisibility {
819 Everyone = 1,
820 MembersOnly = 2,
821 AdministratorsOnly = 3,
822 Nobody = 4,
823 ModeratorsOnly = 5,
824}
825
826impl EmailAddressVisibility {
827 /// Creates a new [EmailAddressVisibility].
828 pub const fn new() -> Self {
829 Self::Everyone
830 }
831}
832
833impl_default!(EmailAddressVisibility);
834impl_display!(EmailAddressVisibility);