From bc689740f09ee8201982455988bf5f4ccb02fe57 Mon Sep 17 00:00:00 2001 From: eal Date: Tue, 16 Jan 2018 02:17:55 +0200 Subject: [PATCH] Add remote follow path to webfinger. --- lib/pleroma/web/ostatus/ostatus.ex | 4 ++++ lib/pleroma/web/web_finger/web_finger.ex | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 745539b3e..e65cab3ed 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -22,6 +22,10 @@ def salmon_path(user) 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) diff --git a/lib/pleroma/web/web_finger/web_finger.ex b/lib/pleroma/web/web_finger/web_finger.ex index 026d2f98b..4ae3eab59 100644 --- a/lib/pleroma/web/web_finger/web_finger.ex +++ b/lib/pleroma/web/web_finger/web_finger.ex @@ -44,7 +44,8 @@ def represent_user(user) 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