From 82ba2a7d5f42e94ac2ce850da94af3a552fba6c1 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 1 Aug 2019 00:04:14 -0400 Subject: [PATCH] Properly load remote profiles --- app/controllers/api/v1/account_by_username_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/v1/account_by_username_controller.rb b/app/controllers/api/v1/account_by_username_controller.rb index 6fb0ed9c..9c748046 100644 --- a/app/controllers/api/v1/account_by_username_controller.rb +++ b/app/controllers/api/v1/account_by_username_controller.rb @@ -11,7 +11,12 @@ class Api::V1::AccountByUsernameController < Api::BaseController end def set_account - @account = Account.find_local!(params[:username]) + user = "#{params[:username]}.#{params[:format]}".split("@") + if user[1] + @account = Account.find_remote!(user[0], user[1]) + else + @account = Account.find_local!(user[0]) + end end def check_account_suspension