about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-03-18 18:03:27 +0100
committerThibaut Girka <thib@sitedethib.com>2019-03-18 18:03:27 +0100
commit291012ec0c08f5323b2102eb4d2dc8714ddce4d9 (patch)
tree09e7a5fef106da1b6ebdc53ac0df62cafc159520 /app/lib
parent6e3a4bcbc70bb33bfb0746cf3b2186ee9f4e6515 (diff)
parentf85b66eb8cc9513822d0ece3928b12aa789bb410 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- app/controllers/accounts_controller.rb
- app/controllers/follower_accounts_controller.rb
- app/controllers/statuses_controller.rb

All conflicts caused by the additional `use_pack` used for glitch-soc's theming
system.
Diffstat (limited to 'app/lib')
-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