Salmon: Take both versions of public keys.
authorlain <lain@soykaf.club>
Sun, 18 Feb 2018 21:57:07 +0000 (22:57 +0100)
committerlain <lain@soykaf.club>
Sun, 18 Feb 2018 21:57:07 +0000 (22:57 +0100)
lib/pleroma/web/salmon/salmon.ex

index 4e95a5b2559de500b62d1642487f5694492a6bba..46ca645d1d37352c2d5545a44eca0751f23ee53d 100644 (file)
@@ -29,7 +29,8 @@ defmodule Pleroma.Web.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