]>
cat aescling's git repositories - mastodon.git/blob - app/controllers/api/v1/accounts_controller.rb
1 class Api
::V1::AccountsController < ApiController
2 before_action
:doorkeeper_authorize!
3 before_action
:set_account, except
: :verify_credentials
10 @account = current_user
.account
15 @following = @account.following
19 @followers = @account.followers
23 @statuses = @account.statuses
.with_includes
.with_counters
.paginate_by_max_id(20, params
[:max_id], params
[:since_id]).to_a
27 FollowService
.new
.call(current_user
.account
, @account.acct
)
29 render action
: :relationship
33 BlockService
.new
.call(current_user
.account
, @account)
35 render action
: :relationship
39 UnfollowService
.new
.call(current_user
.account
, @account)
41 render action
: :relationship
45 UnblockService
.new
.call(current_user
.account
, @account)
47 render action
: :relationship
51 ids
= params
[:id].is_a
?(Enumerable
) ? params
[:id].map(&:to_i) : [params
[:id].to_i
]
52 @accounts = Account
.find(ids
)
53 @following = Account
.following_map(ids
, current_user
.account_id
)
54 @followed_by = Account
.followed_by_map(ids
, current_user
.account_id
)
55 @blocking = Account
.blocking_map(ids
, current_user
.account_id
)
61 @account = Account
.find(params
[:id])
65 @following = Account
.following_map([@account.id
], current_user
.account_id
)
66 @followed_by = Account
.followed_by_map([@account.id
], current_user
.account_id
)
67 @blocking = Account
.blocking_map([@account.id
], current_user
.account_id
)
This page took 0.096496 seconds and 5 git commands to generate.