webfinger: build the response based on enabled federation modules

This commit is contained in:
William Pitcock 2019-05-12 19:05:03 +00:00
commit 28f7f4c6de
5 changed files with 71 additions and 48 deletions

View file

@ -7,6 +7,7 @@ defmodule Pleroma.Web.Websub do
alias Pleroma.Activity
alias Pleroma.Instances
alias Pleroma.Repo
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.Endpoint
alias Pleroma.Web.Federator
@ -313,4 +314,18 @@ defmodule Pleroma.Web.Websub do
{:error, response}
end
end
def gather_webfinger_links(%User{} = user) do
[
%{
"rel" => "http://schemas.google.com/g/2010#updates-from",
"type" => "application/atom+xml",
"href" => OStatus.feed_path(user)
},
%{
"rel" => "http://ostatus.org/schema/1.0/subscribe",
"template" => OStatus.remote_follow_path()
}
]
end
end