about summary refs log tree commit diff
path: root/app/serializers/activitypub/actor_serializer.rb
diff options
context:
space:
mode:
authorpluralcafe-docker <git@plural.cafe>2018-12-17 01:28:17 +0000
committerpluralcafe-docker <git@plural.cafe>2018-12-17 01:28:17 +0000
commitf290c5e2c337bb0aab82cb23653d4ff084ba8bbe (patch)
tree65712093ee4852a04fab5160cea341cb80f91747 /app/serializers/activitypub/actor_serializer.rb
parent87f09d3bebd2d890ecad19d360fc687f1a57f3b0 (diff)
parent396c5dea87f259255f3676bb7b30f5cfdfec9d4e (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/serializers/activitypub/actor_serializer.rb')
-rw-r--r--app/serializers/activitypub/actor_serializer.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 5054bd683..72c30dc73 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -105,7 +105,7 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
   end
 
   def virtual_tags
-    object.emojis
+    object.emojis + object.tags
   end
 
   def virtual_attachments
@@ -119,6 +119,24 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
   class CustomEmojiSerializer < ActivityPub::EmojiSerializer
   end
 
+  class TagSerializer < ActiveModel::Serializer
+    include RoutingHelper
+
+    attributes :type, :href, :name
+
+    def type
+      'Hashtag'
+    end
+
+    def href
+      explore_hashtag_url(object)
+    end
+
+    def name
+      "##{object.name}"
+    end
+  end
+
   class Account::FieldSerializer < ActiveModel::Serializer
     attributes :type, :name, :value