Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
1546538d
Unverified
Commit
1546538d
authored
2 years ago
by
Eugen Rochko
Committed by
GitHub
2 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix improperly checking for blocked domain on followed hashtags (#19472)
Fix #19469
parent
2277913f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/lib/feed_manager.rb
+3
-3
app/lib/feed_manager.rb
with
3 additions
and
3 deletions
+3
-3
app/lib/feed_manager.rb
+
3
-
3
View file @
1546538d
...
...
@@ -253,7 +253,7 @@ class FeedManager
next
if
last_status_score
<
oldest_home_score
end
statuses
=
target_account
.
statuses
.
where
(
visibility:
[
:public
,
:unlisted
,
:private
]).
includes
(
:preloadable_poll
,
:media_attachments
,
reblog: :account
).
limit
(
limit
)
statuses
=
target_account
.
statuses
.
where
(
visibility:
[
:public
,
:unlisted
,
:private
]).
includes
(
:preloadable_poll
,
:media_attachments
,
:account
,
reblog: :account
).
limit
(
limit
)
crutches
=
build_crutches
(
account
.
id
,
statuses
)
statuses
.
each
do
|
status
|
...
...
@@ -426,7 +426,7 @@ class FeedManager
# @param [Hash] crutches
# @return [Boolean]
def
filter_from_tags?
(
status
,
receiver_id
,
crutches
)
receiver_id
!
=
status
.
account_id
&&
(
((
crutches
[
:active_mentions
][
status
.
id
]
||
[])
+
[
status
.
account_id
]).
any?
{
|
target_account_id
|
crutches
[
:blocking
][
target_account_id
]
||
crutches
[
:muting
][
target_account_id
]
}
||
crutches
[
:blocked_by
][
status
.
account_id
]
||
crutches
[
:domain_blocking
][
status
.
account
.
domain
]
)
receiver_id
=
=
status
.
account_id
||
((
crutches
[
:active_mentions
][
status
.
id
]
||
[])
+
[
status
.
account_id
]).
any?
{
|
target_account_id
|
crutches
[
:blocking
][
target_account_id
]
||
crutches
[
:muting
][
target_account_id
]
}
||
crutches
[
:blocked_by
][
status
.
account_id
]
||
crutches
[
:domain_blocking
][
status
.
account
.
domain
]
end
# Adds a status to an account's feed, returning true if a status was
...
...
@@ -547,7 +547,7 @@ class FeedManager
crutches
[
:hiding_reblogs
]
=
Follow
.
where
(
account_id:
receiver_id
,
target_account_id:
statuses
.
map
{
|
s
|
s
.
account_id
if
s
.
reblog?
}.
compact
,
show_reblogs:
false
).
pluck
(
:target_account_id
).
index_with
(
true
)
crutches
[
:blocking
]
=
Block
.
where
(
account_id:
receiver_id
,
target_account_id:
check_for_blocks
).
pluck
(
:target_account_id
).
index_with
(
true
)
crutches
[
:muting
]
=
Mute
.
where
(
account_id:
receiver_id
,
target_account_id:
check_for_blocks
).
pluck
(
:target_account_id
).
index_with
(
true
)
crutches
[
:domain_blocking
]
=
AccountDomainBlock
.
where
(
account_id:
receiver_id
,
domain:
statuses
.
map
{
|
s
|
s
.
reblog
&
.
account
&
.
domain
}.
compact
).
pluck
(
:domain
).
index_with
(
true
)
crutches
[
:domain_blocking
]
=
AccountDomainBlock
.
where
(
account_id:
receiver_id
,
domain:
statuses
.
flat_
map
{
|
s
|
[
s
.
account
.
domain
,
s
.
reblog
&
.
account
&
.
domain
]
}.
compact
).
pluck
(
:domain
).
index_with
(
true
)
crutches
[
:blocked_by
]
=
Block
.
where
(
target_account_id:
receiver_id
,
account_id:
statuses
.
map
{
|
s
|
s
.
reblog
&
.
account_id
}.
compact
).
pluck
(
:account_id
).
index_with
(
true
)
crutches
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets