From 78516a8daa7094506e0247e8bdaddfde77a4ba67 Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 18 Feb 2018 22:57:07 +0100 Subject: [PATCH] Salmon: Take both versions of public keys. --- lib/pleroma/web/salmon/salmon.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex index 4e95a5b25..46ca645d1 100644 --- a/lib/pleroma/web/salmon/salmon.ex +++ b/lib/pleroma/web/salmon/salmon.ex @@ -29,7 +29,8 @@ def fetch_magic_key(salmon) do with [data, _, _, _, _] <- decode(salmon), doc <- XML.parse_document(data), uri when not is_nil(uri) <- XML.string_from_xpath("/entry/author[1]/uri", doc), - {:ok, %{info: %{"magic_key" => magic_key}}} <- Pleroma.Web.OStatus.find_or_make_user(uri) do + {:ok, public_key} <- User.get_public_key_for_ap_id(uri), + magic_key <- encode_key(public_key) do {:ok, magic_key} end end