diff options
author | Surinna Curtis <ekiru.0@gmail.com> | 2017-09-10 14:10:30 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-10 14:10:30 -0500 |
commit | 7a9c7d4e0b694e716cb018e3057792b4d86026fa (patch) | |
tree | 973b16e23a7cbeaf5a43550444e54aa1ace50a46 /app/controllers/api | |
parent | c9df53044a333276853f7dc7ef2aed6d48df087f (diff) | |
parent | 932571fa22273e6ff5c229147668c426b4d65326 (diff) |
Merge pull request #143 from yipdw/sync/upstream
Merge with upstream's 1.6.0
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 |