]>
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
10 @following = @account.following
14 @followers = @account.followers
18 @statuses = @account.statuses
.with_includes
.with_counters
.paginate_by_max_id(20, params
[:max_id] || nil).to_a
22 @follow = FollowService
.new
.(current_user
.account
, @account.acct
)
24 render action
: :relationship
28 @unfollow = UnfollowService
.new
.(current_user
.account
, @account)
30 render action
: :relationship
34 ids
= params
[:id].is_a
?(Enumerable
) ? params
[:id].map
{ |id
| id
.to_i
} : [params
[:id].to_i
]
35 @accounts = Account
.find(ids
)
36 @following = Account
.following_map(ids
, current_user
.account_id
)
37 @followed_by = Account
.followed_by_map(ids
, current_user
.account_id
)
44 @account = Account
.find(params
[:id])
48 @following = Account
.following_map([@account.id
], current_user
.account_id
)
49 @followed_by = Account
.followed_by_map([@account.id
], current_user
.account_id
)
This page took 0.101582 seconds and 5 git commands to generate.