Ignore duplicate create activities.
[akkoma] / lib / pleroma / web / activity_pub / activity_pub_controller.ex
index 7c4f7d24940591bed4fbca81fada2a1c099ebf0e..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
@@ -43,9 +44,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
 
   def inbox(conn, params) do
     Logger.info("Signature error.")
-    Logger.info(conn.req_headers)
+    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