forked from AkkomaGang/akkoma
using atom keys in search params
This commit is contained in:
parent
64b4de4af1
commit
af376cbffb
1 changed files with 11 additions and 8 deletions
|
@ -96,16 +96,18 @@ def response("") do
|
||||||
|
|
||||||
def response("/main/public") do
|
def response("/main/public") do
|
||||||
posts =
|
posts =
|
||||||
ActivityPub.fetch_public_activities(%{"type" => ["Create"], "local_only" => true})
|
%{type: ["Create"], local_only: true}
|
||||||
|> render_activities
|
|> ActivityPub.fetch_public_activities()
|
||||||
|
|> render_activities()
|
||||||
|
|
||||||
info("Welcome to the Public Timeline!") <> posts <> ".\r\n"
|
info("Welcome to the Public Timeline!") <> posts <> ".\r\n"
|
||||||
end
|
end
|
||||||
|
|
||||||
def response("/main/all") do
|
def response("/main/all") do
|
||||||
posts =
|
posts =
|
||||||
ActivityPub.fetch_public_activities(%{"type" => ["Create"]})
|
%{type: ["Create"]}
|
||||||
|> render_activities
|
|> ActivityPub.fetch_public_activities()
|
||||||
|
|> render_activities()
|
||||||
|
|
||||||
info("Welcome to the Federated Timeline!") <> posts <> ".\r\n"
|
info("Welcome to the Federated Timeline!") <> posts <> ".\r\n"
|
||||||
end
|
end
|
||||||
|
@ -130,13 +132,14 @@ def response("/notices/" <> id) do
|
||||||
def response("/users/" <> nickname) do
|
def response("/users/" <> nickname) do
|
||||||
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
with %User{} = user <- User.get_cached_by_nickname(nickname) do
|
||||||
params = %{
|
params = %{
|
||||||
"type" => ["Create"],
|
type: ["Create"],
|
||||||
"actor_id" => user.ap_id
|
actor_id: user.ap_id
|
||||||
}
|
}
|
||||||
|
|
||||||
activities =
|
activities =
|
||||||
ActivityPub.fetch_public_activities(params)
|
params
|
||||||
|> render_activities
|
|> ActivityPub.fetch_public_activities()
|
||||||
|
|> render_activities()
|
||||||
|
|
||||||
info("Posts by #{user.nickname}") <> activities <> ".\r\n"
|
info("Posts by #{user.nickname}") <> activities <> ".\r\n"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue