diff options
Diffstat (limited to 'app/serializers/activitypub/like_serializer.rb')
-rw-r--r-- | app/serializers/activitypub/like_serializer.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/app/serializers/activitypub/like_serializer.rb b/app/serializers/activitypub/like_serializer.rb new file mode 100644 index 000000000..4226913f5 --- /dev/null +++ b/app/serializers/activitypub/like_serializer.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ActivityPub::LikeSerializer < ActiveModel::Serializer + attributes :type, :actor + attribute :virtual_object, key: :object + + def type + 'Like' + end + + def actor + ActivityPub::TagManager.instance.uri_for(object.account) + end + + def virtual_object + ActivityPub::TagManager.instance.uri_for(object.status) + end +end |