diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-15 13:40:54 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-15 14:12:24 -0500 |
commit | 5e3ea221a80d7498d4939386f072d933e6b23dda (patch) | |
tree | e64017e83bbe4dc7689c3663bca19c58359890ed /app/serializers | |
parent | cf3ec71aa564c7fe47ec79f8dd5f14e3bce0b85c (diff) |
add `supports_chat` property, rename `adults_only` to `adult_content`, federate the kobolds~
Diffstat (limited to 'app/serializers')
-rw-r--r-- | app/serializers/activitypub/actor_serializer.rb | 15 | ||||
-rw-r--r-- | app/serializers/rest/account_serializer.rb | 10 |
2 files changed, 5 insertions, 20 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb index 2af3c0701..a260a6f1f 100644 --- a/app/serializers/activitypub/actor_serializer.rb +++ b/app/serializers/activitypub/actor_serializer.rb @@ -7,12 +7,14 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer context_extensions :manually_approves_followers, :featured, :also_known_as, :moved_to, :property_value, :hashtag, :emoji, :identity_proof, - :adults_only + :adult_content, :gently, :kobold, :supports_chat attributes :id, :type, :following, :followers, :inbox, :outbox, :featured, :preferred_username, :name, :summary, - :url, :manually_approves_followers + :url, :manually_approves_followers, + :gently, :kobold, :adult_content, + :supports_chat has_one :public_key, serializer: ActivityPub::PublicKeySerializer @@ -21,7 +23,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer attribute :moved_to, if: :moved? attribute :also_known_as, if: :also_known_as? - attribute :adults_only, key: :suggestedMinAge, if: :adults_only? class EndpointsSerializer < ActivityPub::Serializer include RoutingHelper @@ -68,10 +69,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer account_collection_url(object, :featured) end - def adults_only - 18 - end - def endpoints object end @@ -132,10 +129,6 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer !object.also_known_as.empty? end - def adults_only? - object.adults_only - end - class CustomEmojiSerializer < ActivityPub::EmojiSerializer end diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 7716aafde..852ecdae1 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -6,7 +6,7 @@ class REST::AccountSerializer < ActiveModel::Serializer attributes :id, :username, :acct, :display_name, :locked, :bot, :created_at, :note, :url, :avatar, :avatar_static, :header, :header_static, :followers_count, :following_count, :statuses_count, :replies, - :adults_only, :gentlies_kobolds, :is_a_kobold, :role + :adult_content, :supports_chat, :gently, :kobold, :role has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested? has_many :emojis, serializer: REST::CustomEmojiSerializer @@ -57,14 +57,6 @@ class REST::AccountSerializer < ActiveModel::Serializer (Setting.hide_followers_count || object.user&.setting_hide_followers_count) ? -1 : object.followers_count end - def gentlies_kobolds - object.user_gentlies_kobolds? || false - end - - def is_a_kobold - object.user_is_a_kobold? || false - end - def role return 'admin' if object.user_admin? return 'moderator' if object.user_moderator? |