Fix finding local actor by username with domain

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-10-15 17:19:22 +02:00
parent 48d7606e7e
commit 03f2664b01

View File

@ -1616,6 +1616,12 @@ defmodule Mobilizon.Actors do
from(a in query, where: a.preferred_username == ^name and is_nil(a.domain))
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
from(a in query, where: a.preferred_username == ^name and a.domain == ^domain)
end