From: William Pitcock Date: Sat, 17 Nov 2018 21:00:37 +0000 (+0000) Subject: federator: return :ok or :error depending on if an AP doc was accepted or not X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=0d1375f2746eb927e516064df3fd9fd0ee7e9ff8;p=akkoma federator: return :ok or :error depending on if an AP doc was accepted or not --- diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex index 33e6db9b9..6554fd2ef 100644 --- a/lib/pleroma/web/federator/federator.ex +++ b/lib/pleroma/web/federator/federator.ex @@ -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