projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make the followbot only dispatch follow requests once per 30 day period
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
side_effects.ex
diff --git
a/lib/pleroma/web/activity_pub/side_effects.ex
b/lib/pleroma/web/activity_pub/side_effects.ex
index cb54eb89aeca810d83e10a6bff31e57fad66ceba..0b9a9f0c593793b2773909922b26983c85bce390 100644
(file)
--- a/
lib/pleroma/web/activity_pub/side_effects.ex
+++ b/
lib/pleroma/web/activity_pub/side_effects.ex
@@
-1,12
+1,7
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
# SPDX-License-Identifier: AGPL-3.0-only
-defmodule Pleroma.Web.ActivityPub.SideEffects.Handling do
- @callback handle(map(), keyword()) :: {:ok, map(), keyword()} | {:error, any()}
- @callback handle_after_transaction(map()) :: map()
-end
-
defmodule Pleroma.Web.ActivityPub.SideEffects do
@moduledoc """
This module looks at an inserted object and executes the side effects that it
defmodule Pleroma.Web.ActivityPub.SideEffects do
@moduledoc """
This module looks at an inserted object and executes the side effects that it
@@
-33,6
+28,8
@@
defmodule Pleroma.Web.ActivityPub.SideEffects do
require Logger
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
require Logger
@cachex Pleroma.Config.get([:cachex, :provider], Cachex)
+ @ap_streamer Pleroma.Config.get([:side_effects, :ap_streamer], ActivityPub)
+ @logger Pleroma.Config.get([:side_effects, :logger], Logger)
@behaviour Pleroma.Web.ActivityPub.SideEffects.Handling
@behaviour Pleroma.Web.ActivityPub.SideEffects.Handling
@@
-273,7
+270,7
@@
defmodule Pleroma.Web.ActivityPub.SideEffects do
@impl true
def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object, meta) do
deleted_object =
@impl true
def handle(%{data: %{"type" => "Delete", "object" => deleted_object}} = object, meta) do
deleted_object =
- Object.normalize(deleted_object, false) ||
+ Object.normalize(deleted_object, f
etch: f
alse) ||
User.get_cached_by_ap_id(deleted_object)
result =
User.get_cached_by_ap_id(deleted_object)
result =
@@
-292,12
+289,12
@@
defmodule Pleroma.Web.ActivityPub.SideEffects do
MessageReference.delete_for_object(deleted_object)
MessageReference.delete_for_object(deleted_object)
-
ActivityPub
.stream_out(object)
-
ActivityPub
.stream_out_participations(deleted_object, user)
+
@ap_streamer
.stream_out(object)
+
@ap_streamer
.stream_out_participations(deleted_object, user)
:ok
else
{:actor, _} ->
:ok
else
{:actor, _} ->
-
L
ogger.error("The object doesn't have an actor: #{inspect(deleted_object)}")
+
@l
ogger.error("The object doesn't have an actor: #{inspect(deleted_object)}")
:no_object_actor
end
:no_object_actor
end