mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 16:40: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
|
end
|
||||||
|
|
||||||
defp webfinger_from_xml(doc) do
|
defp webfinger_from_xml(doc) do
|
||||||
with subject <- XML.string_from_xpath("//Subject", doc),
|
subject = XML.string_from_xpath("//Subject", doc)
|
||||||
subscribe_address <-
|
|
||||||
XML.string_from_xpath(
|
subscribe_address =
|
||||||
~s{//Link[@rel="http://ostatus.org/schema/1.0/subscribe"]/@template},
|
~s{//Link[@rel="http://ostatus.org/schema/1.0/subscribe"]/@template}
|
||||||
doc
|
|> XML.string_from_xpath(doc)
|
||||||
),
|
|
||||||
ap_id <-
|
ap_id =
|
||||||
XML.string_from_xpath(
|
~s{//Link[@rel="self" and @type="application/activity+json"]/@href}
|
||||||
~s{//Link[@rel="self" and @type="application/activity+json"]/@href},
|
|> XML.string_from_xpath(doc)
|
||||||
doc
|
|
||||||
) do
|
|
||||||
data = %{
|
data = %{
|
||||||
"subject" => subject,
|
"subject" => subject,
|
||||||
"subscribe_address" => subscribe_address,
|
"subscribe_address" => subscribe_address,
|
||||||
|
@ -106,7 +105,6 @@ defmodule Pleroma.Web.WebFinger do
|
||||||
|
|
||||||
{:ok, data}
|
{:ok, data}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
defp webfinger_from_json(doc) do
|
defp webfinger_from_json(doc) do
|
||||||
data =
|
data =
|
||||||
|
|
Loading…
Reference in a new issue