about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-05 23:07:51 +0200
committerGitHub <noreply@github.com>2018-05-05 23:07:51 +0200
commit2f63d52b925733520b668a2302e7e38d67251c71 (patch)
tree6deb35d848ad567e911b6434120ee2873e6f50df /app/serializers
parentc7d1a2e400cd6677057a8af90fff866207576098 (diff)
Fallback to old on-the-fly URI for follows/blocks if no stored URI (#7371)
Fix #7367
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/activitypub/block_serializer.rb2
-rw-r--r--app/serializers/activitypub/follow_serializer.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/activitypub/block_serializer.rb b/app/serializers/activitypub/block_serializer.rb
index b3bd9f868..624ce2fce 100644
--- a/app/serializers/activitypub/block_serializer.rb
+++ b/app/serializers/activitypub/block_serializer.rb
@@ -5,7 +5,7 @@ class ActivityPub::BlockSerializer < ActiveModel::Serializer
   attribute :virtual_object, key: :object
 
   def id
-    [ActivityPub::TagManager.instance.uri_for(object.account), '#blocks/', object.id].join
+    ActivityPub::TagManager.instance.uri_for(object) || [ActivityPub::TagManager.instance.uri_for(object.account), '#blocks/', object.id].join
   end
 
   def type
diff --git a/app/serializers/activitypub/follow_serializer.rb b/app/serializers/activitypub/follow_serializer.rb
index 24dfe96f8..bb204ee8f 100644
--- a/app/serializers/activitypub/follow_serializer.rb
+++ b/app/serializers/activitypub/follow_serializer.rb
@@ -5,7 +5,7 @@ class ActivityPub::FollowSerializer < ActiveModel::Serializer
   attribute :virtual_object, key: :object
 
   def id
-    ActivityPub::TagManager.instance.uri_for(object)
+    ActivityPub::TagManager.instance.uri_for(object) || [ActivityPub::TagManager.instance.uri_for(object.account), '#follows/', object.id].join
   end
 
   def type