Removing failed push notification API, make context loads use cache
This commit is contained in:
parent
19b9e1e2c3
commit
77e13c2bc9
9 changed files with 13 additions and 98 deletions
|
@ -1,18 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::DevicesController < ApiController
|
||||
before_action -> { doorkeeper_authorize! :read }
|
||||
before_action :require_user!
|
||||
|
||||
respond_to :json
|
||||
|
||||
def register
|
||||
Device.where(account: current_account, registration_id: params[:registration_id]).first_or_create!(account: current_account, registration_id: params[:registration_id])
|
||||
render_empty
|
||||
end
|
||||
|
||||
def unregister
|
||||
Device.where(account: current_account, registration_id: params[:registration_id]).delete_all
|
||||
render_empty
|
||||
end
|
||||
end
|
|
@ -14,7 +14,12 @@ class Api::V1::StatusesController < ApiController
|
|||
end
|
||||
|
||||
def context
|
||||
@context = OpenStruct.new(ancestors: @status.in_reply_to_id.nil? ? [] : @status.ancestors(current_account), descendants: @status.descendants(current_account))
|
||||
ancestors_results = @status.in_reply_to_id.nil? ? [] : @status.ancestors(current_account)
|
||||
descendants_results = @status.descendants(current_account)
|
||||
loaded_ancestors = cache_collection(ancestors_results, Status)
|
||||
loaded_descendants = cache_collection(descendants_results, Status)
|
||||
|
||||
@context = OpenStruct.new(ancestors: loaded_ancestors, descendants: loaded_descendants)
|
||||
statuses = [@status] + @context[:ancestors] + @context[:descendants]
|
||||
|
||||
set_maps(statuses)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue