2019-05-03 08:17:27 +10:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-02-17 15:46:19 +11:00
|
|
|
class UserOptionSerializer < ApplicationSerializer
|
|
|
|
attributes :user_id,
|
|
|
|
:mailing_list_mode,
|
2016-05-21 06:17:54 -07:00
|
|
|
:mailing_list_mode_frequency,
|
2016-02-17 15:46:19 +11:00
|
|
|
:email_digests,
|
2019-03-15 10:55:11 -04:00
|
|
|
:email_level,
|
|
|
|
:email_messages_level,
|
2016-02-17 15:46:19 +11:00
|
|
|
:external_links_in_new_tab,
|
2020-08-28 10:36:52 -04:00
|
|
|
:color_scheme_id,
|
2020-08-06 09:45:37 -04:00
|
|
|
:dark_scheme_id,
|
2016-02-17 15:46:19 +11:00
|
|
|
:dynamic_favicon,
|
|
|
|
:enable_quoting,
|
2019-05-31 15:43:17 +10:00
|
|
|
:enable_defer,
|
2016-03-02 15:26:27 -05:00
|
|
|
:digest_after_minutes,
|
2016-02-17 15:46:19 +11:00
|
|
|
:automatically_unpin_topics,
|
2016-02-18 16:57:22 +11:00
|
|
|
:auto_track_topics_after_msecs,
|
2016-09-30 12:36:43 -04:00
|
|
|
:notification_level_when_replying,
|
2016-02-19 13:56:52 +11:00
|
|
|
:new_topic_duration_minutes,
|
2016-02-26 00:05:40 +11:00
|
|
|
:email_previous_replies,
|
2016-03-02 23:16:52 +11:00
|
|
|
:email_in_reply_to,
|
2016-03-17 17:35:23 -04:00
|
|
|
:like_notification_frequency,
|
2017-05-12 12:41:26 -04:00
|
|
|
:include_tl0_in_digests,
|
2018-07-12 07:18:21 +03:00
|
|
|
:theme_ids,
|
2017-10-06 15:56:58 +08:00
|
|
|
:theme_key_seq,
|
|
|
|
:allow_private_messages,
|
2020-07-20 15:23:49 -06:00
|
|
|
:enable_allowed_pm_users,
|
2017-11-09 12:45:19 -07:00
|
|
|
:homepage_id,
|
2019-01-14 13:21:46 +00:00
|
|
|
:hide_profile_and_presence,
|
2019-01-28 11:19:50 +00:00
|
|
|
:text_size,
|
2019-04-12 00:02:18 +01:00
|
|
|
:text_size_seq,
|
2019-11-25 10:49:27 +10:00
|
|
|
:title_count_mode,
|
2022-12-16 08:50:31 +10:00
|
|
|
:bookmark_auto_delete_preference,
|
2020-08-14 19:10:56 +05:30
|
|
|
:timezone,
|
2021-10-06 14:11:52 +11:00
|
|
|
:skip_new_user_tips,
|
|
|
|
:default_calendar,
|
2022-10-20 04:06:39 +03:00
|
|
|
:oldest_search_log_date,
|
2023-06-22 19:04:13 +03:00
|
|
|
:seen_popups,
|
|
|
|
:sidebar_link_to_filtered_list,
|
2023-07-04 15:08:29 +10:00
|
|
|
:sidebar_show_count_of_new_items,
|
2024-03-08 15:14:46 -07:00
|
|
|
:watched_precedence_over_muted,
|
|
|
|
:topics_unread_when_closed
|
2023-01-09 13:59:43 +00:00
|
|
|
|
|
|
|
def auto_track_topics_after_msecs
|
|
|
|
object.auto_track_topics_after_msecs || SiteSetting.default_other_auto_track_topics_after_msecs
|
|
|
|
end
|
2016-02-18 16:57:22 +11:00
|
|
|
|
2016-09-30 12:36:43 -04:00
|
|
|
def notification_level_when_replying
|
|
|
|
object.notification_level_when_replying ||
|
|
|
|
SiteSetting.default_other_notification_level_when_replying
|
|
|
|
end
|
|
|
|
|
2016-02-18 16:57:22 +11:00
|
|
|
def new_topic_duration_minutes
|
|
|
|
object.new_topic_duration_minutes || SiteSetting.default_other_new_topic_duration_minutes
|
|
|
|
end
|
|
|
|
|
2018-07-12 07:18:21 +03:00
|
|
|
def theme_ids
|
|
|
|
object.theme_ids.presence || [SiteSetting.default_theme_id]
|
2017-05-12 12:41:26 -04:00
|
|
|
end
|
2016-02-17 15:46:19 +11:00
|
|
|
end
|