mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
Apply suggestion to lib/pleroma/web/web_finger/web_finger.ex
This commit is contained in:
parent
6a2905ccf0
commit
d201527004
1 changed files with 16 additions and 18 deletions
|
@ -87,17 +87,16 @@ defmodule Pleroma.Web.WebFinger do
|
|||
end
|
||||
|
||||
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},
|
||||
doc
|
||||
) do
|
||||
subject = XML.string_from_xpath("//Subject", doc)
|
||||
|
||||
subscribe_address =
|
||||
~s{//Link[@rel="http://ostatus.org/schema/1.0/subscribe"]/@template}
|
||||
|> XML.string_from_xpath(doc)
|
||||
|
||||
ap_id =
|
||||
~s{//Link[@rel="self" and @type="application/activity+json"]/@href}
|
||||
|> XML.string_from_xpath(doc)
|
||||
|
||||
data = %{
|
||||
"subject" => subject,
|
||||
"subscribe_address" => subscribe_address,
|
||||
|
@ -106,7 +105,6 @@ defmodule Pleroma.Web.WebFinger do
|
|||
|
||||
{:ok, data}
|
||||
end
|
||||
end
|
||||
|
||||
defp webfinger_from_json(doc) do
|
||||
data =
|
||||
|
|
Loading…
Reference in a new issue