From 48d7606e7e26e0d7237ad141cc881f20e0407de4 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 15 Oct 2020 17:19:15 +0200 Subject: [PATCH 1/2] Improve debug logger message in webfinger module Signed-off-by: Thomas Citharel --- lib/federation/web_finger/web_finger.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/federation/web_finger/web_finger.ex b/lib/federation/web_finger/web_finger.ex index 97f5b2b51..60163ec43 100644 --- a/lib/federation/web_finger/web_finger.ex +++ b/lib/federation/web_finger/web_finger.ex @@ -93,7 +93,7 @@ defmodule Mobilizon.Federation.WebFinger do _ -> Logger.debug(fn -> - "Unhandled type: #{inspect(link["type"])}" + "Unhandled type to finger: #{inspect(link["type"])}" end) data From 03f2664b01995b249e9f3829329e7b8927a9ebf8 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 15 Oct 2020 17:19:22 +0200 Subject: [PATCH 2/2] Fix finding local actor by username with domain Signed-off-by: Thomas Citharel --- lib/mobilizon/actors/actors.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/mobilizon/actors/actors.ex b/lib/mobilizon/actors/actors.ex index d6ee2da76..11579fbd8 100644 --- a/lib/mobilizon/actors/actors.ex +++ b/lib/mobilizon/actors/actors.ex @@ -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