0
0
Fork 0

Cleaning up format of broadcast real-time messages, removing

redis-backed "mentions" timeline as redundant (given notifications)
This commit is contained in:
Eugen Rochko 2017-02-02 00:03:31 +01:00
parent 1da0ce5c7c
commit d9ca46b464
17 changed files with 26 additions and 110 deletions

View file

@ -22,22 +22,6 @@ class Api::V1::TimelinesController < ApiController
render action: :index
end
def mentions
@statuses = Feed.new(:mentions, current_account).get(limit_param(DEFAULT_STATUSES_LIMIT), params[:max_id], params[:since_id])
@statuses = cache_collection(@statuses)
set_maps(@statuses)
set_counters_maps(@statuses)
set_account_counters_maps(@statuses.flat_map { |s| [s.account, s.reblog? ? s.reblog.account : nil] }.compact.uniq)
next_path = api_v1_mentions_timeline_url(max_id: @statuses.last.id) if @statuses.size == limit_param(DEFAULT_STATUSES_LIMIT)
prev_path = api_v1_mentions_timeline_url(since_id: @statuses.first.id) unless @statuses.empty?
set_pagination_headers(next_path, prev_path)
render action: :index
end
def public
@statuses = Status.as_public_timeline(current_account).paginate_by_max_id(limit_param(DEFAULT_STATUSES_LIMIT), params[:max_id], params[:since_id])
@statuses = cache_collection(@statuses)