Don't preload just public events, group draft can be fetched as well

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-07-26 17:22:49 +02:00
parent 6066a44ae8
commit ecfcc4fe83
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773

View file

@ -14,7 +14,7 @@ defmodule Mobilizon.Federation.ActivityPub.Preloader do
@spec maybe_preload(struct()) :: {:ok, struct()} | {:error, struct()} @spec maybe_preload(struct()) :: {:ok, struct()} | {:error, struct()}
def maybe_preload(%Event{url: url}), def maybe_preload(%Event{url: url}),
do: {:ok, Events.get_public_event_by_url_with_preload!(url)} do: {:ok, Events.get_event_by_url!(url)}
def maybe_preload(%Comment{url: url}), def maybe_preload(%Comment{url: url}),
do: {:ok, Discussions.get_comment_from_url_with_preload!(url)} do: {:ok, Discussions.get_comment_from_url_with_preload!(url)}