Merge branch 'fix-online-address' into 'master'

Fix online address validation

See merge request framasoft/mobilizon!450
This commit is contained in:
Thomas Citharel 2020-06-09 11:27:45 +02:00
commit 2e64da11e3
2 changed files with 3 additions and 1 deletions

View file

@ -95,6 +95,8 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
{:ok, activity, event}
else
{:existing_event, %Event{} = event} -> {:ok, nil, event}
{:error, _, _} -> :error
{:error, _} -> :error
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 get_online_address(attachments) do
Enum.find_value(attachments, [], fn attachment ->
Enum.find_value(attachments, fn attachment ->
case attachment do
%{
"type" => "Link",