From fbd874a747e30d6d64188e6aea0e275a0ee3861c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 9 Jun 2020 11:13:22 +0200 Subject: [PATCH] Fix online address validation Signed-off-by: Thomas Citharel --- lib/federation/activity_pub/transmogrifier.ex | 2 ++ lib/federation/activity_stream/converter/event.ex | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/federation/activity_pub/transmogrifier.ex b/lib/federation/activity_pub/transmogrifier.ex index bd2c28bbe..213b481ad 100644 --- a/lib/federation/activity_pub/transmogrifier.ex +++ b/lib/federation/activity_pub/transmogrifier.ex @@ -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 diff --git a/lib/federation/activity_stream/converter/event.ex b/lib/federation/activity_stream/converter/event.ex index 29d4ee061..8a6ce78be 100644 --- a/lib/federation/activity_stream/converter/event.ex +++ b/lib/federation/activity_stream/converter/event.ex @@ -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",