Limit the user and session tracking concerns to the home timeline
This commit is contained in:
parent
da522f8841
commit
4acf7f0bce
@ -91,8 +91,6 @@ class Api::BaseController < ApplicationController
|
|||||||
render json: { error: 'Your account has been flagged as spam. Please contact support@gab.com if you believe this is an error.' }, status: 403
|
render json: { error: 'Your account has been flagged as spam. Please contact support@gab.com if you believe this is an error.' }, status: 403
|
||||||
elsif !current_user.approved?
|
elsif !current_user.approved?
|
||||||
render json: { error: 'Your login is currently pending approval' }, status: 403
|
render json: { error: 'Your login is currently pending approval' }, status: 403
|
||||||
else
|
|
||||||
set_user_activity
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Api::V1::Timelines::HomeController < Api::BaseController
|
class Api::V1::Timelines::HomeController < Api::BaseController
|
||||||
|
|
||||||
before_action :require_user!, only: [:show]
|
before_action :require_user!, only: [:show]
|
||||||
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
after_action :insert_pagination_headers, unless: -> { @statuses.empty? }
|
||||||
|
|
||||||
|
include UserTrackingConcern
|
||||||
|
include SessionTrackingConcern
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@statuses = load_statuses
|
@statuses = load_statuses
|
||||||
render json: @statuses,
|
render json: @statuses,
|
||||||
@ -33,6 +37,8 @@ class Api::V1::Timelines::HomeController < Api::BaseController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def account_home_feed
|
def account_home_feed
|
||||||
|
set_user_activity
|
||||||
|
set_session_activity
|
||||||
HomeFeed.new(current_account)
|
HomeFeed.new(current_account)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
|
|||||||
protect_from_forgery with: :exception
|
protect_from_forgery with: :exception
|
||||||
|
|
||||||
include Localized
|
include Localized
|
||||||
include UserTrackingConcern
|
|
||||||
include SessionTrackingConcern
|
|
||||||
|
|
||||||
helper_method :current_account
|
helper_method :current_account
|
||||||
helper_method :current_session
|
helper_method :current_session
|
||||||
|
Loading…
Reference in New Issue
Block a user