mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-29 14:15:08 +01:00
ForceBotUnlistedPolicy: format
This commit is contained in:
parent
57cf0cc3b3
commit
8b695c3eeb
@ -21,14 +21,14 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicy do
|
||||
|
||||
@impl true
|
||||
def filter(
|
||||
%{
|
||||
"type" => "Create",
|
||||
"to" => to,
|
||||
"cc" => cc,
|
||||
"actor" => actor,
|
||||
"object" => object
|
||||
} = message
|
||||
) do
|
||||
%{
|
||||
"type" => "Create",
|
||||
"to" => to,
|
||||
"cc" => cc,
|
||||
"actor" => actor,
|
||||
"object" => object
|
||||
} = message
|
||||
) do
|
||||
user = User.get_cached_by_ap_id(actor)
|
||||
isbot = 0.8 < botness_score(user)
|
||||
|
||||
|
@ -10,18 +10,19 @@ defmodule Pleroma.Web.ActivityPub.MRF.ForceBotUnlistedPolicyTest do
|
||||
|
||||
defp generate_messages(actor) do
|
||||
{%{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Create",
|
||||
"object" => %{},
|
||||
"to" => [@public, "f"],
|
||||
"cc" => [actor.follower_address, "d"]
|
||||
}, %{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Create",
|
||||
"object" => %{"to" => ["f", actor.follower_address], "cc" => ["d", @public]},
|
||||
"to" => ["f", actor.follower_address],
|
||||
"cc" => ["d", @public]
|
||||
}}
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Create",
|
||||
"object" => %{},
|
||||
"to" => [@public, "f"],
|
||||
"cc" => [actor.follower_address, "d"]
|
||||
},
|
||||
%{
|
||||
"actor" => actor.ap_id,
|
||||
"type" => "Create",
|
||||
"object" => %{"to" => ["f", actor.follower_address], "cc" => ["d", @public]},
|
||||
"to" => ["f", actor.follower_address],
|
||||
"cc" => ["d", @public]
|
||||
}}
|
||||
end
|
||||
|
||||
test "removes from the federated timeline by nickname heuristics 1" do
|
||||
|
Loading…
Reference in New Issue
Block a user