diff options
author | Starfall <us@starfall.systems> | 2023-01-17 11:41:05 -0600 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2023-01-17 11:41:05 -0600 |
commit | 1f9c919b8769f5b0a3424ef343e0049d33d656e3 (patch) | |
tree | 1853486629da4b3b76192fe8756e8d4f6d71adcb /app/serializers/rest | |
parent | 957c21273ff42d5b2b4a5e16b7869bbb09aeb865 (diff) | |
parent | 13227e1dafd308dfe1a3effc3379b766274809b3 (diff) |
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'app/serializers/rest')
-rw-r--r-- | app/serializers/rest/preferences_serializer.rb | 5 | ||||
-rw-r--r-- | app/serializers/rest/relationship_serializer.rb | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/app/serializers/rest/preferences_serializer.rb b/app/serializers/rest/preferences_serializer.rb index 874bd990d..e1c654460 100644 --- a/app/serializers/rest/preferences_serializer.rb +++ b/app/serializers/rest/preferences_serializer.rb @@ -7,6 +7,7 @@ class REST::PreferencesSerializer < ActiveModel::Serializer attribute :reading_default_sensitive_media, key: 'reading:expand:media' attribute :reading_default_sensitive_text, key: 'reading:expand:spoilers' + attribute :reading_autoplay_gifs, key: 'reading:autoplay:gifs' def posting_default_privacy object.user.setting_default_privacy @@ -27,4 +28,8 @@ class REST::PreferencesSerializer < ActiveModel::Serializer def reading_default_sensitive_text object.user.setting_expand_spoilers end + + def reading_autoplay_gifs + object.user.setting_auto_play_gif + end end diff --git a/app/serializers/rest/relationship_serializer.rb b/app/serializers/rest/relationship_serializer.rb index 31fc60eb2..b53387401 100644 --- a/app/serializers/rest/relationship_serializer.rb +++ b/app/serializers/rest/relationship_serializer.rb @@ -2,8 +2,8 @@ class REST::RelationshipSerializer < ActiveModel::Serializer attributes :id, :following, :showing_reblogs, :notifying, :languages, :followed_by, - :blocking, :blocked_by, :muting, :muting_notifications, :requested, - :domain_blocking, :endorsed, :note + :blocking, :blocked_by, :muting, :muting_notifications, + :requested, :requested_by, :domain_blocking, :endorsed, :note def id object.id.to_s @@ -54,6 +54,10 @@ class REST::RelationshipSerializer < ActiveModel::Serializer instance_options[:relationships].requested[object.id] ? true : false end + def requested_by + instance_options[:relationships].requested_by[object.id] ? true : false + end + def domain_blocking instance_options[:relationships].domain_blocking[object.id] || false end |