about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-01-04 14:40:49 +0100
committerGitHub <noreply@github.com>2018-01-04 14:40:49 +0100
commit02ba03d6dba9e5633013e50366daabe573759168 (patch)
tree075aa39be96811563879369a45fb390293cbffa4 /app/serializers
parent3bee0996c509f4b416096094061edbc9c10f5632 (diff)
Send one Delete of Actor in ActivityPub when account is suspended (#6172)
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/delete_actor_serializer.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/serializers/activitypub/delete_actor_serializer.rb b/app/serializers/activitypub/delete_actor_serializer.rb
new file mode 100644
index 000000000..dfea9db4a
--- /dev/null
+++ b/app/serializers/activitypub/delete_actor_serializer.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class ActivityPub::DeleteActorSerializer < ActiveModel::Serializer
+  attributes :id, :type, :actor
+  attribute :virtual_object, key: :object
+
+  def id
+    [ActivityPub::TagManager.instance.uri_for(object), '#delete'].join
+  end
+
+  def type
+    'Delete'
+  end
+
+  def actor
+    ActivityPub::TagManager.instance.uri_for(object)
+  end
+
+  def virtual_object
+    actor
+  end
+end