Merge branch 'remote-profile-fix' into 'develop'

Actually fix remote profile loading

See merge request gab/social/gab-social!30
This commit is contained in:
Rob Colbert
2019-08-05 04:51:57 +00:00
2 changed files with 5 additions and 6 deletions

View File

@@ -11,12 +11,11 @@ class Api::V1::AccountByUsernameController < Api::BaseController
end
def set_account
user = params[:username].split("@")
if user[1]
user[1] = "#{user[1]}.#{params[:format]}"
@account = Account.find_remote!(user[0], user[1])
username, domain = params[:username].split("@")
if domain
@account = Account.find_remote!(username, domain)
else
@account = Account.find_local!(user[0])
@account = Account.find_local!(username)
end
end