From 35938656ab4186912ee6593cc09754ef945e17fc Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Mon, 1 May 2017 14:07:29 +0200 Subject: [PATCH] Make user keys on usage. --- lib/pleroma/web/federator/federator.ex | 2 ++ lib/pleroma/web/web_finger/web_finger.ex | 1 + 2 files changed, 3 insertions(+) diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex index 5293507b5..675e804a2 100644 --- a/lib/pleroma/web/federator/federator.ex +++ b/lib/pleroma/web/federator/federator.ex @@ -1,5 +1,6 @@ defmodule Pleroma.Web.Federator do alias Pleroma.User + alias Pleroma.Web.WebFinger require Logger @websub Application.get_env(:pleroma, :websub) @@ -10,6 +11,7 @@ defmodule Pleroma.Web.Federator do Logger.debug("Sending #{activity.data["id"]} out via websub") Pleroma.Web.Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity) + {:ok, actor} = WebFinger.ensure_keys_present(actor) Logger.debug("Sending #{activity.data["id"]} out via salmon") Pleroma.Web.Salmon.publish(actor, activity) end diff --git a/lib/pleroma/web/web_finger/web_finger.ex b/lib/pleroma/web/web_finger/web_finger.ex index f8f4d5e42..ff10173ef 100644 --- a/lib/pleroma/web/web_finger/web_finger.ex +++ b/lib/pleroma/web/web_finger/web_finger.ex @@ -47,6 +47,7 @@ defmodule Pleroma.Web.WebFinger do |> XmlBuilder.to_doc end + # This seems a better fit in Salmon def ensure_keys_present(user) do info = user.info || %{} if info["keys"] do -- 2.45.2