mirror of
https://github.com/mastodon/mastodon
synced 2025-04-12 00:56:38 +02:00
Add support for numeric IDs to local account lookup via URI
This commit is contained in:
parent
6e330d2b2a
commit
3661890e9f
@ -274,10 +274,9 @@ class ActivityPub::TagManager
|
||||
|
||||
path_params = Rails.application.routes.recognize_path(uri)
|
||||
|
||||
# TODO: handle numeric IDs
|
||||
case path_params[:controller]
|
||||
when 'accounts'
|
||||
[:username, path_params[:username]]
|
||||
path_params.key?(:username) ? [:username, path_params[:username]] : [:id, path_params[:id]]
|
||||
when 'instance_actors'
|
||||
[:id, -99]
|
||||
end
|
||||
|
@ -6,7 +6,7 @@ RSpec.describe ActivityPub::SynchronizeFollowersService do
|
||||
subject { described_class.new }
|
||||
|
||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') }
|
||||
let(:alice) { Fabricate(:account, username: 'alice') }
|
||||
let(:alice) { Fabricate(:account, username: 'alice', id_scheme: :numeric_ap_id) }
|
||||
let(:bob) { Fabricate(:account, username: 'bob') }
|
||||
let(:eve) { Fabricate(:account, username: 'eve') }
|
||||
let(:mallory) { Fabricate(:account, username: 'mallory') }
|
||||
|
Loading…
x
Reference in New Issue
Block a user