From 2f63d52b925733520b668a2302e7e38d67251c71 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 5 May 2018 23:07:51 +0200 Subject: [PATCH] Fallback to old on-the-fly URI for follows/blocks if no stored URI (#7371) Fix #7367 --- app/serializers/activitypub/block_serializer.rb | 2 +- app/serializers/activitypub/follow_serializer.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/serializers/activitypub/block_serializer.rb b/app/serializers/activitypub/block_serializer.rb index b3bd9f868e..624ce2fce8 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 24dfe96f89..bb204ee8f3 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