diff options
author | unarist <m.unarist@gmail.com> | 2017-09-09 01:20:03 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-09-08 18:20:03 +0200 |
commit | a12572e074581832744b243f2fadd1742e8418b6 (patch) | |
tree | 9139c1f0fcfb3e48b426a479dab5c565ce356639 /app | |
parent | dabc309ca3329c455e4e26a8bf9a691fcafe20a7 (diff) |
Handle stream_entry URL correctly in ActivityPub (#4854)
In before, the method uses stream_entry id as status id, so replied status was wrongly selected. This PR uses StatusFinder which was introduced with `Api::Web::EmbedsController`.
Diffstat (limited to 'app')
-rw-r--r-- | app/lib/activitypub/tag_manager.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/lib/activitypub/tag_manager.rb b/app/lib/activitypub/tag_manager.rb index de575d9e6..929e87852 100644 --- a/app/lib/activitypub/tag_manager.rb +++ b/app/lib/activitypub/tag_manager.rb @@ -96,12 +96,14 @@ class ActivityPub::TagManager when 'Account' klass.find_local(uri_to_local_id(uri, :username)) else - klass.find_by(id: uri_to_local_id(uri)) + StatusFinder.new(uri).status end elsif ::TagManager.instance.local_id?(uri) klass.find_by(id: ::TagManager.instance.unique_tag_to_local_id(uri, klass.to_s)) else klass.find_by(uri: uri.split('#').first) end + rescue ActiveRecord::RecordNotFound + nil end end |