Add remote follow path to webfinger.
authoreal <eal@waifu.club>
Tue, 16 Jan 2018 00:17:55 +0000 (02:17 +0200)
committereal <eal@waifu.club>
Thu, 18 Jan 2018 00:38:02 +0000 (02:38 +0200)
lib/pleroma/web/ostatus/ostatus.ex
lib/pleroma/web/web_finger/web_finger.ex

index 745539b3e0f68790ceeee8e20c3b73aff26dd3ee..e65cab3ed47d030bbb235bb6adff163b9822df68 100644 (file)
@@ -22,6 +22,10 @@ defmodule Pleroma.Web.OStatus do
     "#{user.ap_id}/salmon"
   end
 
+  def remote_follow_path do
+    "#{Web.base_url}/ostatus_subscribe?acct={uri}"
+  end
+
   def handle_incoming(xml_string) do
     with doc when doc != :error <- parse_document(xml_string) do
       entries = :xmerl_xpath.string('//entry', doc)
index 026d2f98bd908e455677070f8eac59f92513ccca..4ae3eab594b27a58f75358508cf6b0fc77f69c4a 100644 (file)
@@ -44,7 +44,8 @@ defmodule Pleroma.Web.WebFinger do
         {:Link, %{rel: "http://schemas.google.com/g/2010#updates-from", type: "application/atom+xml", href: OStatus.feed_path(user)}},
         {:Link, %{rel: "http://webfinger.net/rel/profile-page", type: "text/html", href: user.ap_id}},
         {:Link, %{rel: "salmon", href: OStatus.salmon_path(user)}},
-        {:Link, %{rel: "magic-public-key", href: "data:application/magic-public-key,#{magic_key}"}}
+        {:Link, %{rel: "magic-public-key", href: "data:application/magic-public-key,#{magic_key}"}},
+        {:Link, %{rel: "http://ostatus.org/schema/1.0/subscribe", template: OStatus.remote_follow_path()}}
       ]
     }
     |> XmlBuilder.to_doc