diff options
author | David Yip <yipdw@member.fsf.org> | 2017-09-10 13:04:27 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-09-10 13:04:27 -0500 |
commit | 932571fa22273e6ff5c229147668c426b4d65326 (patch) | |
tree | 973b16e23a7cbeaf5a43550444e54aa1ace50a46 /app/controllers/api | |
parent | c9df53044a333276853f7dc7ef2aed6d48df087f (diff) | |
parent | ab71cf4593ed3259168c641d5f4f5a0ebbe4d045 (diff) |
Merge tag 'v1.6.0' into sync/upstream
Diffstat (limited to 'app/controllers/api')
-rw-r--r-- | app/controllers/api/v1/follows_controller.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/api/v1/follows_controller.rb b/app/controllers/api/v1/follows_controller.rb index e01ae5c01..5a2b2f32f 100644 --- a/app/controllers/api/v1/follows_controller.rb +++ b/app/controllers/api/v1/follows_controller.rb @@ -10,6 +10,12 @@ class Api::V1::FollowsController < Api::BaseController raise ActiveRecord::RecordNotFound if follow_params[:uri].blank? @account = FollowService.new.call(current_user.account, target_uri).try(:target_account) + + if @account.nil? + username, domain = target_uri.split('@') + @account = Account.find_remote!(username, domain) + end + render json: @account, serializer: REST::AccountSerializer end |