Merge branch 'feld-varnish' into 'develop'
[akkoma] / lib / pleroma / web / web_finger / web_finger.ex
index e45c0ed8d33385acdc936e61e36bd0ca50beb5bb..6ffa80a43b6e0ed7cb8e5ce44a693f370a07f4c8 100644 (file)
@@ -1,7 +1,7 @@
 defmodule Pleroma.Web.WebFinger do
   @httpoison Application.get_env(:pleroma, :httpoison)
 
-  alias Pleroma.{Repo, User, XmlBuilder}
+  alias Pleroma.{User, XmlBuilder}
   alias Pleroma.Web
   alias Pleroma.Web.{XML, Salmon, OStatus}
   require Jason
@@ -81,7 +81,10 @@ defmodule Pleroma.Web.WebFinger do
           "href" => user.ap_id
         },
         %{"rel" => "salmon", "href" => OStatus.salmon_path(user)},
-        %{"rel" => "magic-public-key", "href" => "data:application/magic-public-key,#{magic_key}"},
+        %{
+          "rel" => "magic-public-key",
+          "href" => "data:application/magic-public-key,#{magic_key}"
+        },
         %{"rel" => "self", "type" => "application/activity+json", "href" => user.ap_id},
         %{
           "rel" => "http://ostatus.org/schema/1.0/subscribe",
@@ -236,13 +239,14 @@ defmodule Pleroma.Web.WebFinger do
           URI.parse(account).host
       end
 
-    case find_lrdd_template(domain) do
-      {:ok, template} ->
-        address = String.replace(template, "{uri}", URI.encode(account))
+    address =
+      case find_lrdd_template(domain) do
+        {:ok, template} ->
+          String.replace(template, "{uri}", URI.encode(account))
 
-      _ ->
-        address = "http://#{domain}/.well-known/webfinger?resource=acct:#{account}"
-    end
+        _ ->
+          "http://#{domain}/.well-known/webfinger?resource=acct:#{account}"
+      end
 
     with response <-
            @httpoison.get(