federator: return :ok or :error depending on if an AP doc was accepted or not
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 17 Nov 2018 21:00:37 +0000 (21:00 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 17 Nov 2018 21:00:37 +0000 (21:00 +0000)
lib/pleroma/web/federator/federator.ex

index 33e6db9b92070a8dbbd1ea686be2765636c3937c..6554fd2ef4d6ca89f1d014ec31bb3b9d2bd8a60c 100644 (file)
@@ -106,15 +106,18 @@ defmodule Pleroma.Web.Federator do
     with {:ok, _user} <- ap_enabled_actor(params["actor"]),
          nil <- Activity.normalize(params["id"]),
          :ok <- Transmogrifier.contain_origin_from_id(params["actor"], params),
-         {:ok, _activity} <- Transmogrifier.handle_incoming(params) do
+         {:ok, activity} <- Transmogrifier.handle_incoming(params) do
+      {:ok, activity}
     else
       %Activity{} ->
         Logger.info("Already had #{params["id"]}")
+        :error
 
       _e ->
         # Just drop those for now
         Logger.info("Unhandled activity")
         Logger.info(Poison.encode!(params, pretty: 2))
+        :error
     end
   end