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
92362e1e
Commit
92362e1e
authored
Dec 22, 2018
by
Karen Konou
Browse files
Implement large thread filter
parent
61a88a67
Pipeline
#5638
failed with stages
in 6 minutes and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/config.exs
View file @
92362e1e
...
...
@@ -163,6 +163,8 @@
allow_followersonly:
false
,
allow_direct:
false
config
:pleroma
,
:mrf_hellthreadmitigation
,
threshold:
10
config
:pleroma
,
:mrf_simple
,
media_removal:
[],
media_nsfw:
[],
...
...
lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex
0 → 100644
View file @
92362e1e
defmodule
Pleroma
.
Web
.
ActivityPub
.
MRF
.
HellthreadPolicy
do
@behaviour
Pleroma
.
Web
.
ActivityPub
.
MRF
@impl
true
def
filter
(
object
)
do
policy
=
Pleroma
.
Config
.
get
(
:mrf_hellthreadmitigation
)
if
(
length
(
object
[
"to"
])
+
length
(
object
[
"cc"
]))
>
Keyword
.
get
(
policy
,
:threshold
)
do
{
:reject
,
nil
}
else
{
:ok
,
object
}
end
end
end
\ No newline at end of file
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