This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2019-03-14 18:39:20 -07: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'
|
|
|
|
|
|
|
|
attribute :reading_default_sensitive_media, key: 'reading:expand:media'
|
|
|
|
attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers'
|
|
|
|
|
|
|
|
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 10:13:36 -07:00
|
|
|
object.user.preferred_posting_language
|
2019-03-14 18:39:20 -07:00
|
|
|
end
|
|
|
|
|
|
|
|
def reading_default_sensitive_media
|
|
|
|
object.user.setting_display_media
|
|
|
|
end
|
|
|
|
|
|
|
|
def reading_default_sensitive_text
|
|
|
|
object.user.setting_expand_spoilers
|
|
|
|
end
|
|
|
|
end
|