Send out salmons before websub.
authorLain Iwakura <lain@soykaf.club>
Mon, 18 Dec 2017 15:16:22 +0000 (16:16 +0100)
committerLain Iwakura <lain@soykaf.club>
Mon, 18 Dec 2017 15:16:22 +0000 (16:16 +0100)
lib/pleroma/web/federator/federator.ex

index b23ed5fcc71d15fa65f6de9aef6aacc397577407..c9f9dc7a1ec1eb677f2815f4e49e0766debc0b74 100644 (file)
@@ -41,12 +41,12 @@ defmodule Pleroma.Web.Federator do
   def handle(:publish, activity) do
     Logger.debug(fn -> "Running publish for #{activity.data["id"]}" end)
     with actor when not is_nil(actor) <- User.get_cached_by_ap_id(activity.data["actor"]) do
-      Logger.debug(fn -> "Sending #{activity.data["id"]} out via websub" end)
-      Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity)
-
       {:ok, actor} = WebFinger.ensure_keys_present(actor)
       Logger.debug(fn -> "Sending #{activity.data["id"]} out via salmon" end)
       Pleroma.Web.Salmon.publish(actor, activity)
+
+      Logger.debug(fn -> "Sending #{activity.data["id"]} out via websub" end)
+      Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity)
     end
   end