Merge branch 'finmoji-optional' into 'develop'
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 361e93e91c8b081c9422d08091027772dd93d213..fc191addf38ed0820ac872fea861481f18e650c5 100644 (file)
@@ -683,7 +683,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       (Pleroma.Web.Salmon.remote_users(activity) ++ followers)
       |> Enum.filter(fn user -> User.ap_enabled?(user) end)
       |> Enum.map(fn %{info: %{"source_data" => data}} ->
-        (data["endpoints"] && data["endpoints"]["sharedInbox"]) || data["inbox"]
+        (is_map(data["endpoints"]) && Map.get(data["endpoints"], "sharedInbox")) || data["inbox"]
       end)
       |> Enum.uniq()
       |> Enum.filter(fn inbox -> should_federate?(inbox, public) end)
@@ -756,6 +756,9 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
            {:ok, activity} <- Transmogrifier.handle_incoming(params) do
         {:ok, Object.normalize(activity.data["object"])}
       else
+        {:error, {:reject, nil}} ->
+          {:reject, nil}
+
         object = %Object{} ->
           {:ok, object}