about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorpluralcafe-docker <git@plural.cafe>2019-01-12 04:24:14 +0000
committerpluralcafe-docker <git@plural.cafe>2019-01-12 04:24:14 +0000
commitae24ef877b82466cab026a76ea6ed8598ddaae18 (patch)
tree584c25ada377f2e6da49a9b45b3da947501b1831 /app/serializers
parentfa1ab7fbe4166f3d8b481891dcc443df5aa212bb (diff)
parent2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff)
Merge branch 'glitch'
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/actor_serializer.rb5
-rw-r--r--app/serializers/rest/scheduled_status_serializer.rb15
2 files changed, 20 insertions, 0 deletions
diff --git a/app/serializers/activitypub/actor_serializer.rb b/app/serializers/activitypub/actor_serializer.rb
index 72c30dc73..6746c1782 100644
--- a/app/serializers/activitypub/actor_serializer.rb
+++ b/app/serializers/activitypub/actor_serializer.rb
@@ -14,6 +14,7 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
   has_many :virtual_attachments, key: :attachment
 
   attribute :moved_to, if: :moved?
+  attribute :also_known_as, if: :also_known_as?
 
   class EndpointsSerializer < ActiveModel::Serializer
     include RoutingHelper
@@ -116,6 +117,10 @@ class ActivityPub::ActorSerializer < ActiveModel::Serializer
     ActivityPub::TagManager.instance.uri_for(object.moved_to_account)
   end
 
+  def also_known_as?
+    !object.also_known_as.empty?
+  end
+
   class CustomEmojiSerializer < ActivityPub::EmojiSerializer
   end
 
diff --git a/app/serializers/rest/scheduled_status_serializer.rb b/app/serializers/rest/scheduled_status_serializer.rb
new file mode 100644
index 000000000..5d6311b87
--- /dev/null
+++ b/app/serializers/rest/scheduled_status_serializer.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class REST::ScheduledStatusSerializer < ActiveModel::Serializer
+  attributes :id, :scheduled_at, :params
+
+  has_many :media_attachments, serializer: REST::MediaAttachmentSerializer
+
+  def id
+    object.id.to_s
+  end
+
+  def params
+    object.params.without(:application_id)
+  end
+end