Fix online address validation

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2020-06-09 11:13:22 +02:00
parent d25e63cabb
commit 2634c7f46b
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 3 additions and 1 deletions

View File

@ -95,6 +95,8 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
{:ok, activity, event} {:ok, activity, event}
else else
{:existing_event, %Event{} = event} -> {:ok, nil, event} {:existing_event, %Event{} = event} -> {:ok, nil, event}
{:error, _, _} -> :error
{:error, _} -> :error
end end
end end

View File

@ -226,7 +226,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Event do
defp date_to_string(%DateTime{} = date), do: DateTime.to_iso8601(date) defp date_to_string(%DateTime{} = date), do: DateTime.to_iso8601(date)
defp get_online_address(attachments) do defp get_online_address(attachments) do
Enum.find_value(attachments, [], fn attachment -> Enum.find_value(attachments, fn attachment ->
case attachment do case attachment do
%{ %{
"type" => "Link", "type" => "Link",