about summary refs log tree commit diff
path: root/app/lib/activitypub/activity/flag.rb
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-03-21 15:35:55 -0700
committerReverite <github@reverite.sh>2019-03-21 15:35:55 -0700
commit592735fd80acd0aeffb5a5674255ed48d7a8db0b (patch)
tree0eefc67f624a07df0af860edecd68d5dc64c7ee9 /app/lib/activitypub/activity/flag.rb
parent75eeb003b09c53d3b4e98046d1c20b0ad8a887bb (diff)
parentbde9196b70299405ebe9b16500b7a3f65539b2c3 (diff)
Merge remote-tracking branch 'glitch/master' into production
Diffstat (limited to 'app/lib/activitypub/activity/flag.rb')
-rw-r--r--app/lib/activitypub/activity/flag.rb7
1 files changed, 6 insertions, 1 deletions
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