about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-07-13 02:16:06 +0200
committerGitHub <noreply@github.com>2018-07-13 02:16:06 +0200
commite55dce3176b7ac0a23a8a652c2626707a1b74dbb (patch)
tree12d129849083dc0d17e372cb13d549c39dc40d51 /app/serializers
parent401559c376078ef98e11c3034977b835b4086b5b (diff)
Add federation relay support (#7998)
* Add federation relay support

* Add admin UI for managing relays

* Include actor on relay-related activities

* Fix i18n
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/delete_actor_serializer.rb6
-rw-r--r--app/serializers/activitypub/delete_serializer.rb6
-rw-r--r--app/serializers/activitypub/undo_announce_serializer.rb6
-rw-r--r--app/serializers/activitypub/update_serializer.rb6
4 files changed, 20 insertions, 4 deletions
diff --git a/app/serializers/activitypub/delete_actor_serializer.rb b/app/serializers/activitypub/delete_actor_serializer.rb
index dfea9db4a..ddf59be97 100644
--- a/app/serializers/activitypub/delete_actor_serializer.rb
+++ b/app/serializers/activitypub/delete_actor_serializer.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class ActivityPub::DeleteActorSerializer < ActiveModel::Serializer
-  attributes :id, :type, :actor
+  attributes :id, :type, :actor, :to
   attribute :virtual_object, key: :object
 
   def id
@@ -19,4 +19,8 @@ class ActivityPub::DeleteActorSerializer < ActiveModel::Serializer
   def virtual_object
     actor
   end
+
+  def to
+    [ActivityPub::TagManager::COLLECTIONS[:public]]
+  end
 end
diff --git a/app/serializers/activitypub/delete_serializer.rb b/app/serializers/activitypub/delete_serializer.rb
index 2bb65135f..5012a8383 100644
--- a/app/serializers/activitypub/delete_serializer.rb
+++ b/app/serializers/activitypub/delete_serializer.rb
@@ -17,7 +17,7 @@ class ActivityPub::DeleteSerializer < ActiveModel::Serializer
     end
   end
 
-  attributes :id, :type, :actor
+  attributes :id, :type, :actor, :to
 
   has_one :object, serializer: TombstoneSerializer
 
@@ -32,4 +32,8 @@ class ActivityPub::DeleteSerializer < ActiveModel::Serializer
   def actor
     ActivityPub::TagManager.instance.uri_for(object.account)
   end
+
+  def to
+    [ActivityPub::TagManager::COLLECTIONS[:public]]
+  end
 end
diff --git a/app/serializers/activitypub/undo_announce_serializer.rb b/app/serializers/activitypub/undo_announce_serializer.rb
index 839847e22..4fc042727 100644
--- a/app/serializers/activitypub/undo_announce_serializer.rb
+++ b/app/serializers/activitypub/undo_announce_serializer.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class ActivityPub::UndoAnnounceSerializer < ActiveModel::Serializer
-  attributes :id, :type, :actor
+  attributes :id, :type, :actor, :to
 
   has_one :object, serializer: ActivityPub::ActivitySerializer
 
@@ -16,4 +16,8 @@ class ActivityPub::UndoAnnounceSerializer < ActiveModel::Serializer
   def actor
     ActivityPub::TagManager.instance.uri_for(object.account)
   end
+
+  def to
+    [ActivityPub::TagManager::COLLECTIONS[:public]]
+  end
 end
diff --git a/app/serializers/activitypub/update_serializer.rb b/app/serializers/activitypub/update_serializer.rb
index ebc667d96..48d7a1929 100644
--- a/app/serializers/activitypub/update_serializer.rb
+++ b/app/serializers/activitypub/update_serializer.rb
@@ -1,7 +1,7 @@
 # frozen_string_literal: true
 
 class ActivityPub::UpdateSerializer < ActiveModel::Serializer
-  attributes :id, :type, :actor
+  attributes :id, :type, :actor, :to
 
   has_one :object, serializer: ActivityPub::ActorSerializer
 
@@ -16,4 +16,8 @@ class ActivityPub::UpdateSerializer < ActiveModel::Serializer
   def actor
     ActivityPub::TagManager.instance.uri_for(object)
   end
+
+  def to
+    [ActivityPub::TagManager::COLLECTIONS[:public]]
+  end
 end