Fix relay outbox endpoint
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -394,6 +394,7 @@ defmodule Mobilizon.Actors.Actor do
|
||||
"keys" => Crypto.generate_rsa_2048_private_key(),
|
||||
"preferred_username" => "relay",
|
||||
"domain" => nil,
|
||||
"visibility" => :public,
|
||||
"type" => :Application
|
||||
}
|
||||
|
||||
|
||||
@@ -239,6 +239,16 @@ defmodule Mobilizon.Discussions do
|
||||
Repo.all(from(c in Comment, where: c.visibility == ^:public))
|
||||
end
|
||||
|
||||
@spec list_local_comments(integer | nil, integer | nil) :: Page.t()
|
||||
def list_local_comments(page \\ nil, limit \\ nil) do
|
||||
Comment
|
||||
|> where([c], c.visibility == ^:public)
|
||||
|> where([c], is_nil(c.deleted_at))
|
||||
|> where([c], is_nil(c.discussion_id))
|
||||
|> preload_for_comment()
|
||||
|> Page.build_page(page, limit)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns the list of public comments for the actor.
|
||||
"""
|
||||
|
||||
@@ -375,6 +375,16 @@ defmodule Mobilizon.Events do
|
||||
|> Repo.stream()
|
||||
end
|
||||
|
||||
@spec list_public_local_events(integer | nil, integer | nil) :: Page.t()
|
||||
def list_public_local_events(page \\ nil, limit \\ nil) do
|
||||
Event
|
||||
|> filter_public_visibility()
|
||||
|> filter_draft()
|
||||
|> filter_local()
|
||||
|> preload_for_event()
|
||||
|> Page.build_page(page, limit)
|
||||
end
|
||||
|
||||
@doc """
|
||||
Returns the list of events with the same tags.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user