Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
aabf884c
Commit
aabf884c
authored
8 years ago
by
Eugen Rochko
Browse files
Options
Downloads
Patches
Plain Diff
Discard misattributed remote statuses, improve timelines filter
parent
17903c6d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/models/status.rb
+1
-0
1 addition, 0 deletions
app/models/status.rb
app/services/process_feed_service.rb
+13
-4
13 additions, 4 deletions
app/services/process_feed_service.rb
spec/rails_helper.rb
+1
-0
1 addition, 0 deletions
spec/rails_helper.rb
with
15 additions
and
4 deletions
app/models/status.rb
+
1
−
0
View file @
aabf884c
...
...
@@ -121,6 +121,7 @@ class Status < ApplicationRecord
def
filter_timeline
(
query
,
account
)
blocked
=
Block
.
where
(
account:
account
).
pluck
(
:target_account_id
)
return
query
if
blocked
.
empty?
query
.
joins
(
'LEFT OUTER JOIN statuses AS parents ON statuses.in_reply_to_id = parents.id'
)
...
...
This diff is collapsed.
Click to expand it.
app/services/process_feed_service.rb
+
13
−
4
View file @
aabf884c
...
...
@@ -48,6 +48,8 @@ class ProcessFeedService < BaseService
if
original_status
.
nil?
status
.
destroy
return
nil
elsif
original_status
.
reblog?
status
.
reblog
=
original_status
.
reblog
end
end
...
...
@@ -73,10 +75,17 @@ class ProcessFeedService < BaseService
status
=
find_status
(
id
(
entry
))
return
status
unless
status
.
nil?
begin
account
=
account?
(
entry
)
?
find_or_resolve_account
(
acct
(
entry
))
:
@account
rescue
Goldfinger
::
Error
return
nil
# If status embeds an author, find that author
# If that author cannot be found, don't record the status (do not misattribute)
if
account?
(
entry
)
begin
account
=
find_or_resolve_account
(
acct
(
entry
))
return
nil
if
account
.
nil?
rescue
Goldfinger
::
Error
return
nil
end
else
account
=
@account
end
status
=
Status
.
create!
({
...
...
This diff is collapsed.
Click to expand it.
spec/rails_helper.rb
+
1
−
0
View file @
aabf884c
...
...
@@ -15,6 +15,7 @@ Sidekiq::Testing.inline!
RSpec
.
configure
do
|
config
|
config
.
fixture_path
=
"
#{
::
Rails
.
root
}
/spec/fixtures"
config
.
use_transactional_fixtures
=
true
config
.
order
=
'random'
config
.
infer_spec_type_from_file_location!
config
.
filter_rails_from_backtrace!
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment