mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-11 20:21:10 +00: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)
|
path_params = Rails.application.routes.recognize_path(uri)
|
||||||
|
|
||||||
# TODO: handle numeric IDs
|
|
||||||
case path_params[:controller]
|
case path_params[:controller]
|
||||||
when 'accounts'
|
when 'accounts'
|
||||||
[:username, path_params[:username]]
|
path_params.key?(:username) ? [:username, path_params[:username]] : [:id, path_params[:id]]
|
||||||
when 'instance_actors'
|
when 'instance_actors'
|
||||||
[:id, -99]
|
[:id, -99]
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,7 +6,7 @@ RSpec.describe ActivityPub::SynchronizeFollowersService do
|
||||||
subject { described_class.new }
|
subject { described_class.new }
|
||||||
|
|
||||||
let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account', inbox_url: 'http://example.com/inbox') }
|
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(:bob) { Fabricate(:account, username: 'bob') }
|
||||||
let(:eve) { Fabricate(:account, username: 'eve') }
|
let(:eve) { Fabricate(:account, username: 'eve') }
|
||||||
let(:mallory) { Fabricate(:account, username: 'mallory') }
|
let(:mallory) { Fabricate(:account, username: 'mallory') }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user