forked from AkkomaGang/akkoma
Add That Thing
This commit is contained in:
parent
7624ea5f93
commit
21765150ad
1 changed files with 47 additions and 0 deletions
47
lib/pleroma/web/activity_pub/mrf/dont_boost_guppe_replies.ex
Normal file
47
lib/pleroma/web/activity_pub/mrf/dont_boost_guppe_replies.ex
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Pleroma: A lightweight social networking server
|
||||
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
|
||||
defmodule Pleroma.Web.ActivityPub.MRF.DontBoostGuppeReplies do
|
||||
alias Pleroma.User
|
||||
@moduledoc "Ignores boosts that have a reply to a guppe account, written by foxes@myfriendsare.gay"
|
||||
@behaviour Pleroma.Web.ActivityPub.MRF.Policy
|
||||
|
||||
alias Pleroma.Object
|
||||
|
||||
require Logger
|
||||
|
||||
def history_awareness, do: :auto
|
||||
|
||||
def filter(
|
||||
%{
|
||||
"type" => "Announce",
|
||||
"actor" => actor,
|
||||
"object" => object
|
||||
} = message
|
||||
) do
|
||||
|
||||
if actor =~ "https://a.gup.pe/u/" do
|
||||
child = Object.get_by_ap_id(object).data
|
||||
if child["inReplyTo"] != nil do
|
||||
Logger.debug("GUPPE REJECT #{object}")
|
||||
{:reject, message}
|
||||
else
|
||||
Logger.debug("GUPPE ALLOW #{object}")
|
||||
{:ok, message}
|
||||
end
|
||||
{:ok, message}
|
||||
else
|
||||
{:ok, message}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
@impl true
|
||||
def filter(message), do: {:ok, message}
|
||||
|
||||
@impl true
|
||||
def describe, do: {:ok, %{}}
|
||||
end
|
Loading…
Reference in a new issue