WebFinger: Add back in subscribe_address.
authorlain <lain@soykaf.club>
Tue, 5 May 2020 07:36:38 +0000 (09:36 +0200)
committerlain <lain@soykaf.club>
Tue, 5 May 2020 07:36:38 +0000 (09:36 +0200)
It's used for remote following.

lib/pleroma/web/web_finger/web_finger.ex

index b264538282cbb200cf0bb87b337abbacab5c8673..d0775fa286803af63948e63b10f714befbb3a9af 100644 (file)
@@ -88,6 +88,11 @@ defmodule Pleroma.Web.WebFinger do
 
   defp webfinger_from_xml(doc) do
     with subject <- XML.string_from_xpath("//Subject", doc),
+         subscribe_address <-
+           XML.string_from_xpath(
+             ~s{//Link[@rel="http://ostatus.org/schema/1.0/subscribe"]/@template},
+             doc
+           ),
          ap_id <-
            XML.string_from_xpath(
              ~s{//Link[@rel="self" and @type="application/activity+json"]/@href},
@@ -95,6 +100,7 @@ defmodule Pleroma.Web.WebFinger do
            ) do
       data = %{
         "subject" => subject,
+        "subscribe_address" => subscribe_address,
         "ap_id" => ap_id
       }