diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/activitypub/adapter.rb | 4 | ||||
-rw-r--r-- | app/serializers/activitypub/actor_serializer.rb | 10 | ||||
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 8 | ||||
-rw-r--r-- | app/serializers/rest/account_serializer.rb | 6 | ||||
-rw-r--r-- | app/serializers/rest/status_serializer.rb | 7 |
5 files changed, 29 insertions, 6 deletions
diff --git a/app/lib/activitypub/adapter.rb b/app/lib/activitypub/adapter.rb index b10c588a2..1a4502bcd 100644 --- a/app/lib/activitypub/adapter.rb +++ b/app/lib/activitypub/adapter.rb @@ -28,6 +28,10 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base 'mp' => 'https://monsterpit.net/#', 'trans' => 'mp:trans', }, + chest: { + 'mp' => 'https://monsterpit.net/#', + 'chest' => 'mp:chest', + }, adult_content: { 'mp' => 'https://monsterpit.net/ns#', 'adultContent' => 'mp:adultContent' diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb index 7297d7c42..a7260fa15 100644 --- a/app/serializers/activitypub/actor_serializer.rb +++ b/app/serializers/activitypub/actor_serializer.rb @@ -7,14 +7,16 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer context_extensions :manually_approves_followers, :featured, :also_known_as, :moved_to, :property_value, :hashtag, :emoji, - :adult_content, :gently, :kobold, :froze, :big, :trans + :adult_content, :gently, :kobold, :froze, :big, :trans, + :chest attributes :id, :type, :following, :followers, :inbox, :outbox, :featured, :preferred_username, :name, :summary, :url, :manually_approves_followers, :gently, :kobold, :adult_content, - :froze, :tails_never_fail, :trans + :froze, :tails_never_fail, :trans, + :chest has_one :public_key, serializer: ActivityPub::PublicKeySerializer @@ -45,6 +47,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer 'rights' end + def chest + 'floof' + end + def id account_url(object) end diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index bc9fcacf4..3749fcd22 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -3,13 +3,13 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer context_extensions :conversation, :sensitive, :big, :hashtag, :emoji, :focal_point, :blurhash, - :reject_replies, :trans + :reject_replies, :trans, :chest attributes :id, :type, :summary, :in_reply_to, :published, :updated, :url, :attributed_to, :to, :cc, :sensitive, :conversation, :source, :tails_never_fail, - :reject_replies, :trans + :reject_replies, :trans, :chest attribute :content attribute :content_map, if: :language? @@ -29,6 +29,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer 'rights' end + def chest + 'floof' + end + def id raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only? ActivityPub::TagManager.instance.uri_for(object) diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index a8b905b16..5c1dc64dc 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -7,7 +7,7 @@ class REST::AccountSerializer < ActiveModel::Serializer :updated_at, :note, :url, :avatar, :avatar_static, :header, :header_static, :followers_count, :following_count, :statuses_count, :replies, :adult_content, :gently, :kobold, :role, :froze, :identity, - :limited, :signature, :trans + :limited, :signature, :trans, :chest has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested? has_many :emojis, serializer: REST::CustomEmojiSerializer @@ -26,6 +26,10 @@ class REST::AccountSerializer < ActiveModel::Serializer 'rights' end + def chest + 'floof' + end + def id object.id.to_s end diff --git a/app/serializers/rest/status_serializer.rb b/app/serializers/rest/status_serializer.rb index 0a98b2ecd..a071d2375 100644 --- a/app/serializers/rest/status_serializer.rb +++ b/app/serializers/rest/status_serializer.rb @@ -6,7 +6,8 @@ class REST::StatusSerializer < ActiveModel::Serializer attributes :id, :created_at, :updated_at, :in_reply_to_id, :in_reply_to_account_id, :sensitive, :spoiler_text, :visibility, :language, :uri, :url, :replies_count, :reblogs_count, - :favourites_count, :network, :curated, :reject_replies, :trans + :favourites_count, :network, :curated, :reject_replies, :trans, + :chest attribute :favourited, if: :current_user? attribute :reblogged, if: :current_user? @@ -38,6 +39,10 @@ class REST::StatusSerializer < ActiveModel::Serializer 'rights' end + def chest + 'floof' + end + def id object.id.to_s end |