Merge branch 'webfinger-fixes' into 'master'

Webfinger fixes

See merge request framasoft/mobilizon!614
This commit is contained in:
Thomas Citharel 2020-10-15 17:46:43 +02:00
commit 489b91a7dd
2 changed files with 7 additions and 1 deletions

View file

@ -93,7 +93,7 @@ defmodule Mobilizon.Federation.WebFinger do
_ -> _ ->
Logger.debug(fn -> Logger.debug(fn ->
"Unhandled type: #{inspect(link["type"])}" "Unhandled type to finger: #{inspect(link["type"])}"
end) end)
data data

View file

@ -1616,6 +1616,12 @@ defmodule Mobilizon.Actors do
from(a in query, where: a.preferred_username == ^name and is_nil(a.domain)) from(a in query, where: a.preferred_username == ^name and is_nil(a.domain))
end end
@own_domain Mobilizon.Config.instance_hostname()
defp filter_by_name(query, [name, @own_domain]) do
filter_by_name(query, [name])
end
defp filter_by_name(query, [name, domain]) do defp filter_by_name(query, [name, domain]) do
from(a in query, where: a.preferred_username == ^name and a.domain == ^domain) from(a in query, where: a.preferred_username == ^name and a.domain == ^domain)
end end