projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed Map,put arguments, updated nomenclature
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
activity_pub_controller.ex
diff --git
a/lib/pleroma/web/activity_pub/activity_pub_controller.ex
b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
index 7eed0a6006d86154400cfb50b69978ae281d1ac5..4dea6ab83ee21ac87ee92f750151ef9751d8a76e 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
@@
-4,6
+4,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
use Pleroma.Web, :controller
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
use Pleroma.Web, :controller
+
alias Pleroma.{Activity, User, Object}
alias Pleroma.Web.ActivityPub.{ObjectView, UserView}
alias Pleroma.Web.ActivityPub.ActivityPub
alias Pleroma.{Activity, User, Object}
alias Pleroma.Web.ActivityPub.{ObjectView, UserView}
alias Pleroma.Web.ActivityPub.ActivityPub
@@
-17,6
+18,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
action_fallback(:errors)
plug(Pleroma.Web.FederatingPlug when action in [:inbox, :relay])
action_fallback(:errors)
plug(Pleroma.Web.FederatingPlug when action in [:inbox, :relay])
+ plug(:set_requester_reachable when action in [:inbox])
plug(:relay_active? when action in [:relay])
def relay_active?(conn, _) do
plug(:relay_active? when action in [:relay])
def relay_active?(conn, _) do
@@
-289,4
+291,13
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|> put_status(500)
|> json("error")
end
|> put_status(500)
|> json("error")
end
+
+ defp set_requester_reachable(%Plug.Conn{} = conn, _) do
+ with actor <- conn.params["actor"],
+ true <- is_binary(actor) do
+ Pleroma.Instances.set_reachable(actor)
+ end
+
+ conn
+ end
end
end