Fix depreciated calls of fetch_env!/2 and get_env/2
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -83,7 +83,7 @@ defmodule Mobilizon.Federation.ActivityPub.Federator do
|
||||
def enqueue(type, payload, priority \\ 1) do
|
||||
Logger.debug("enqueue something with type #{inspect(type)}")
|
||||
|
||||
if Application.fetch_env!(:mobilizon, :env) == :test do
|
||||
if Application.compile_env(:mobilizon, :env) == :test do
|
||||
handle(type, payload)
|
||||
else
|
||||
GenServer.cast(__MODULE__, {:enqueue, type, payload, priority})
|
||||
|
||||
@@ -205,7 +205,7 @@ defmodule Mobilizon.Federation.WebFinger do
|
||||
{:ok, String.t()} | {:error, :link_not_found} | {:error, any()}
|
||||
defp find_webfinger_endpoint(domain) when is_binary(domain) do
|
||||
Logger.debug("Calling HostMetaClient for #{domain}")
|
||||
prefix = if Application.fetch_env!(:mobilizon, :env) !== :dev, do: "https", else: "http"
|
||||
prefix = if Application.compile_env(:mobilizon, :env) !== :dev, do: "https", else: "http"
|
||||
|
||||
with {:ok, %Tesla.Env{status: 200, body: body}} <-
|
||||
HostMetaClient.get("#{prefix}://#{domain}/.well-known/host-meta"),
|
||||
@@ -229,7 +229,10 @@ defmodule Mobilizon.Federation.WebFinger do
|
||||
|
||||
_ ->
|
||||
Logger.debug("Using default webfinger location")
|
||||
prefix = if Application.fetch_env!(:mobilizon, :env) !== :dev, do: "https", else: "http"
|
||||
|
||||
prefix =
|
||||
if Application.compile_env(:mobilizon, :env) !== :dev, do: "https", else: "http"
|
||||
|
||||
"#{prefix}://#{domain}/.well-known/webfinger?resource=acct:#{actor}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user