2019-03-15 01:39:20 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::PreferencesSerializer < ActiveModel::Serializer
|
|
|
|
attribute :posting_default_privacy, key: 'posting:default:visibility'
|
|
|
|
attribute :posting_default_sensitive, key: 'posting:default:sensitive'
|
|
|
|
attribute :posting_default_language, key: 'posting:default:language'
|
2022-12-02 05:23:10 +00:00
|
|
|
attribute :posting_default_federation, key: 'posting:default:federation'
|
2019-03-15 01:39:20 +00:00
|
|
|
|
|
|
|
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
|
|
|
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
2023-01-05 12:31:05 +00:00
|
|
|
attribute :reading_autoplay_gifs, key: 'reading:autoplay:gifs'
|
2019-03-15 01:39:20 +00:00
|
|
|
|
|
|
|
def posting_default_privacy
|
|
|
|
object.user.setting_default_privacy
|
|
|
|
end
|
|
|
|
|
|
|
|
def posting_default_sensitive
|
|
|
|
object.user.setting_default_sensitive
|
|
|
|
end
|
|
|
|
|
|
|
|
def posting_default_language
|
2022-05-16 18:13:36 +01:00
|
|
|
object.user.preferred_posting_language
|
2019-03-15 01:39:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def reading_default_sensitive_media
|
|
|
|
object.user.setting_display_media
|
|
|
|
end
|
|
|
|
|
|
|
|
def reading_default_sensitive_text
|
|
|
|
object.user.setting_expand_spoilers
|
|
|
|
end
|
2022-12-02 05:23:10 +00:00
|
|
|
|
|
|
|
def posting_default_federation
|
|
|
|
object.user.setting_default_federation
|
|
|
|
end
|
2023-01-24 00:46:13 +00:00
|
|
|
|
2023-01-05 12:31:05 +00:00
|
|
|
def reading_autoplay_gifs
|
|
|
|
object.user.setting_auto_play_gif
|
|
|
|
end
|
2019-03-15 01:39:20 +00:00
|
|
|
end
|