]> cat aescling's git repositories - mastodon.git/commitdiff
Fix dereferencing remote statuses not using the correct account (#14656)
authorThibG <thib@sitedethib.com>
Mon, 24 Aug 2020 14:56:21 +0000 (16:56 +0200)
committerGitHub <noreply@github.com>
Mon, 24 Aug 2020 14:56:21 +0000 (16:56 +0200)
Follow-up to #14359

In the case of limited toots, the receiver may not be explicitly part of the
audience. If a specific user's inbox URI was specified, it makes sense to
dereference the toot from the corresponding user, instead of trying to find
someone in the explicit audience.

app/lib/activitypub/activity.rb

index f0ef4d553d8b551fd991163ecbbdb17181a2a924..a379a7ef431364c5f050fab3c3bc15f52fc436c9 100644 (file)
@@ -168,6 +168,8 @@ class ActivityPub::Activity
   end
 
   def signed_fetch_account
+    return Account.find(@options[:delivered_to_account_id]) if @options[:delivered_to_account_id].present?
+
     first_mentioned_local_account || first_local_follower
   end