From a20354a20b9dffada0e8d6170ebc2ff13c79baea Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 17 Mar 2019 15:34:56 +0100 Subject: Set and store report URIs (#10303) Fixes #10271 --- app/lib/activitypub/activity/flag.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'app/lib') diff --git a/app/lib/activitypub/activity/flag.rb b/app/lib/activitypub/activity/flag.rb index 0d10d6c3c..f73b93058 100644 --- a/app/lib/activitypub/activity/flag.rb +++ b/app/lib/activitypub/activity/flag.rb @@ -14,7 +14,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity @account, target_account, status_ids: target_statuses.nil? ? [] : target_statuses.map(&:id), - comment: @json['content'] || '' + comment: @json['content'] || '', + uri: report_uri ) end end @@ -28,4 +29,8 @@ class ActivityPub::Activity::Flag < ActivityPub::Activity def object_uris @object_uris ||= Array(@object.is_a?(Array) ? @object.map { |item| value_or_id(item) } : value_or_id(@object)) end + + def report_uri + @json['id'] unless @json['id'].nil? || invalid_origin?(@json['id']) + end end -- cgit