Make user keys on usage.
This commit is contained in:
parent
e54e592d6c
commit
35938656ab
2 changed files with 3 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
defmodule Pleroma.Web.Federator do
|
defmodule Pleroma.Web.Federator do
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
alias Pleroma.Web.WebFinger
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
@websub Application.get_env(:pleroma, :websub)
|
@websub Application.get_env(:pleroma, :websub)
|
||||||
|
@ -10,6 +11,7 @@ def handle(:publish, activity) do
|
||||||
Logger.debug("Sending #{activity.data["id"]} out via websub")
|
Logger.debug("Sending #{activity.data["id"]} out via websub")
|
||||||
Pleroma.Web.Websub.publish(Pleroma.Web.OStatus.feed_path(actor), actor, activity)
|
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")
|
Logger.debug("Sending #{activity.data["id"]} out via salmon")
|
||||||
Pleroma.Web.Salmon.publish(actor, activity)
|
Pleroma.Web.Salmon.publish(actor, activity)
|
||||||
end
|
end
|
||||||
|
|
|
@ -47,6 +47,7 @@ def represent_user(user) do
|
||||||
|> XmlBuilder.to_doc
|
|> XmlBuilder.to_doc
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This seems a better fit in Salmon
|
||||||
def ensure_keys_present(user) do
|
def ensure_keys_present(user) do
|
||||||
info = user.info || %{}
|
info = user.info || %{}
|
||||||
if info["keys"] do
|
if info["keys"] do
|
||||||
|
|
Loading…
Reference in a new issue