]>
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, :suggestions]
10 @account = current_user
.account
15 @following = @account.following
19 @followers = @account.followers
23 @accounts = FollowSuggestion
.get(current_user
.account_id
)
27 @statuses = @account.statuses
.with_includes
.with_counters
.paginate_by_max_id(20, params
[:max_id], params
[:since_id]).to_a
31 FollowService
.new
.call(current_user
.account
, @account.acct
)
33 render action
: :relationship
37 BlockService
.new
.call(current_user
.account
, @account)
39 render action
: :relationship
43 UnfollowService
.new
.call(current_user
.account
, @account)
45 render action
: :relationship
49 UnblockService
.new
.call(current_user
.account
, @account)
51 render action
: :relationship
55 ids
= params
[:id].is_a
?(Enumerable
) ? params
[:id].map(&:to_i) : [params
[:id].to_i
]
56 @accounts = Account
.find(ids
)
57 @following = Account
.following_map(ids
, current_user
.account_id
)
58 @followed_by = Account
.followed_by_map(ids
, current_user
.account_id
)
59 @blocking = Account
.blocking_map(ids
, current_user
.account_id
)
65 @account = Account
.find(params
[:id])
69 @following = Account
.following_map([@account.id
], current_user
.account_id
)
70 @followed_by = Account
.followed_by_map([@account.id
], current_user
.account_id
)
71 @blocking = Account
.blocking_map([@account.id
], current_user
.account_id
)
This page took 0.133767 seconds and 4 git commands to generate.