Ignore duplicate create activities.
[akkoma] / lib / pleroma / web / activity_pub / activity_pub_controller.ex
index da4973fe571e7e4db431c4844b9ed615658b50f2..835e8bd9de586cb206a115a9cdc9751d48d99c69 100644 (file)
@@ -25,6 +25,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
   # TODO: Ensure that this inbox is a recipient of the message
   def inbox(%{assigns: %{valid_signature: true}} = conn, params) do
     # File.write("/tmp/incoming.json", Poison.encode!(params))
+    # Logger.info(Poison.encode!(params, [pretty: 2]))
     with {:ok, _user} <- ap_enabled_actor(params["actor"]),
          nil <- Activity.get_by_ap_id(params["id"]),
          {:ok, activity} <- Transmogrifier.handle_incoming(params) do
@@ -41,6 +42,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
     end
   end
 
+  def inbox(conn, params) do
+    Logger.info("Signature error.")
+    Logger.info(inspect(conn.req_headers))
+    json(conn, "ok")
+  end
+
   def ap_enabled_actor(id) do
     user = User.get_by_ap_id(id)
     if User.ap_enabled?(user) do