0
0
Fork 0

Distrubute statuses as a fan-out-on-write system, with optional precomputing

This commit is contained in:
Eugen Rochko 2016-03-08 20:16:11 +01:00
parent fe57f6330f
commit 6c4c84b161
9 changed files with 119 additions and 3 deletions

View file

@ -22,10 +22,12 @@ class Api::StatusesController < ApiController
end
def home
@statuses = Status.where(account: [current_user.account] + current_user.account.following).order('created_at desc')
feed = Feed.new(:home, current_user.account)
@statuses = feed.get(20, (params[:offset] || 0).to_i)
end
def mentions
@statuses = Status.where(id: Mention.where(account: current_user.account).pluck(:status_id)).order('created_at desc')
feed = Feed.new(:mentions, current_user.account)
@statuses = feed.get(20, (params[:offset] || 0).to_i)
end
end