Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
social
gab-social
Commits
4acf7f0b
Commit
4acf7f0b
authored
Feb 19, 2021
by
Fosco Marotto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Limit the user and session tracking concerns to the home timeline
parent
da522f88
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
4 deletions
+6
-4
app/controllers/api/base_controller.rb
app/controllers/api/base_controller.rb
+0
-2
app/controllers/api/v1/timelines/home_controller.rb
app/controllers/api/v1/timelines/home_controller.rb
+6
-0
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+0
-2
No files found.
app/controllers/api/base_controller.rb
View file @
4acf7f0b
...
...
@@ -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
elsif
!
current_user
.
approved?
render
json:
{
error:
'Your login is currently pending approval'
},
status:
403
else
set_user_activity
end
end
...
...
app/controllers/api/v1/timelines/home_controller.rb
View file @
4acf7f0b
# frozen_string_literal: true
class
Api::V1::Timelines::HomeController
<
Api
::
BaseController
before_action
:require_user!
,
only:
[
:show
]
after_action
:insert_pagination_headers
,
unless:
->
{
@statuses
.
empty?
}
include
UserTrackingConcern
include
SessionTrackingConcern
def
show
@statuses
=
load_statuses
render
json:
@statuses
,
...
...
@@ -33,6 +37,8 @@ class Api::V1::Timelines::HomeController < Api::BaseController
end
def
account_home_feed
set_user_activity
set_session_activity
HomeFeed
.
new
(
current_account
)
end
...
...
app/controllers/application_controller.rb
View file @
4acf7f0b
...
...
@@ -6,8 +6,6 @@ class ApplicationController < ActionController::Base
protect_from_forgery
with: :exception
include
Localized
include
UserTrackingConcern
include
SessionTrackingConcern
helper_method
:current_account
helper_method
:current_session
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment