Conversation
Notices
-
Embed this notice
glitter (glitter@bbs.kawa-kun.com)'s status on Monday, 24-Mar-2025 03:11:15 JST glitter
hey @tk add moons filter in the server plsssssss i’m tired of nicole - Doughnut Lollipop 【記録係】:blobfoxgooglymlem: likes this.
-
Embed this notice
dilbert 1 (sun@shitposter.world)'s status on Monday, 24-Mar-2025 03:14:00 JST dilbert 1
@glitter @tk
```
defmodule Site.RejectFediverseChick do
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
require Logger
@impl true
def filter(
%{
"to" => mto,
"cc" => mcc,
"type" => "Create",
"object" => %{
"type" => "Note",
"to" => oto,
"cc" => occ,
"content" => content,
},
} = message
) do
mall = ((mto++mcc)++oto)++occ |> Enum.uniq()
if is_local_single_dm?(mall) && String.contains?(String.downcase(content), "fediverse chick") do
{:reject, "fediverse chick"}
else
{:ok, message}
end
end
def filter(message), do: {:ok, message}
@impl true
def describe, do: {:ok, %{}}
defp is_local_single_dm?(recipients) when is_list(recipients) do
with 1 <- length(recipients),
[ "https://shitposter.world/" <> _ | _ ] <- recipients do
true
else
_ -> false
end
end
end
```
adapt to your own server