Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
8f98d970
Commit
8f98d970
authored
Feb 17, 2019
by
rinpatch
Browse files
Fix recipient count in hellthread policy
parent
1ce1b7b5
Pipeline
#7789
failed with stages
in 4 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex
View file @
8f98d970
...
...
@@ -12,14 +12,14 @@ defp delist_message(message, threshold) when threshold > 0 do
follower_collection?
=
Enum
.
member?
(
message
[
"to"
]
++
message
[
"cc"
],
follower_collection
)
message
=
case
recipients
=
get_recipient_count
(
message
)
do
{
:public
,
_
}
case
get_recipient_count
(
message
)
do
{
:public
,
recipients
}
when
follower_collection?
and
recipients
>
threshold
->
message
|>
Map
.
put
(
"to"
,
[
follower_collection
])
|>
Map
.
put
(
"cc"
,
[
"https://www.w3.org/ns/activitystreams#Public"
])
{
:public
,
_
}
when
recipients
>
threshold
->
{
:public
,
recipients
}
when
recipients
>
threshold
->
message
|>
Map
.
put
(
"to"
,
[])
|>
Map
.
put
(
"cc"
,
[
"https://www.w3.org/ns/activitystreams#Public"
])
...
...
Write
Preview
Supports
Markdown
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