monsterpit says trans rights!!!

master
multiple creatures 2020-01-04 10:16:52 -06:00
parent 244a90b45e
commit d0769f0309
5 changed files with 26 additions and 6 deletions

View File

@ -24,6 +24,10 @@ class ActivityPub::Adapter < ActiveModelSerializers::Adapter::Base
'Big' => 'https://tails.monsterpit.net/#',
'tailsNeverFail' => 'Big:tailsNeverFail',
},
trans: {
'mp' => 'https://monsterpit.net/#',
'trans' => 'mp:trans',
},
adult_content: {
'mp' => 'https://monsterpit.net/ns#',
'adultContent' => 'mp:adultContent'

View File

@ -7,14 +7,14 @@ 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
:adult_content, :gently, :kobold, :froze, :big, :trans
attributes :id, :type, :following, :followers,
:inbox, :outbox, :featured,
:preferred_username, :name, :summary,
:url, :manually_approves_followers,
:gently, :kobold, :adult_content,
:froze, :tails_never_fail
:froze, :tails_never_fail, :trans
has_one :public_key, serializer: ActivityPub::PublicKeySerializer
@ -41,6 +41,10 @@ class ActivityPub::ActorSerializer < ActivityPub::Serializer
delegate :moved?, to: :object
def trans
'rights'
end
def id
account_url(object)
end

View File

@ -3,13 +3,13 @@
class ActivityPub::NoteSerializer < ActivityPub::Serializer
context_extensions :conversation, :sensitive, :big,
:hashtag, :emoji, :focal_point, :blurhash,
:reject_replies
:reject_replies, :trans
attributes :id, :type, :summary,
:in_reply_to, :published, :updated, :url,
:attributed_to, :to, :cc, :sensitive,
:conversation, :source, :tails_never_fail,
:reject_replies
:reject_replies, :trans
attribute :content
attribute :content_map, if: :language?
@ -25,6 +25,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
attribute :end_time, if: :poll_and_expires?
attribute :closed, if: :poll_and_expired?
def trans
'rights'
end
def id
raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only?
ActivityPub::TagManager.instance.uri_for(object)

View File

@ -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
:limited, :signature, :trans
has_one :moved_to_account, key: :moved, serializer: REST::AccountSerializer, if: :moved_and_not_nested?
has_many :emojis, serializer: REST::CustomEmojiSerializer
@ -22,6 +22,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
has_many :fields
def trans
'rights'
end
def id
object.id.to_s
end

View File

@ -6,7 +6,7 @@ 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
:favourites_count, :network, :curated, :reject_replies, :trans
attribute :favourited, if: :current_user?
attribute :reblogged, if: :current_user?
@ -33,6 +33,10 @@ class REST::StatusSerializer < ActiveModel::Serializer
has_one :preview_card, key: :card, serializer: REST::PreviewCardSerializer
has_one :preloadable_poll, key: :poll, serializer: REST::PollSerializer
def trans
'rights'
end
def id
object.id.to_s
end