feat(activitypub): allow simple text for address field

Closes #1387

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-12-19 10:52:31 +01:00
parent 8544278c9a
commit 64237cfc26
3 changed files with 93 additions and 12 deletions

View File

@@ -278,8 +278,8 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Utils do
end
@spec get_address(map | binary | nil) :: Address.t() | nil
def get_address(address_url) when is_binary(address_url) do
get_address(%{"id" => address_url})
def get_address(text_address) when is_binary(text_address) do
get_address(%{"type" => "Place", "name" => text_address})
end
def get_address(%{"id" => url} = map) when is_map(map) and is_binary(url) do