projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfix: Reuse Controller.Helper pagination for APC2S
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
activity_pub_controller.ex
diff --git
a/lib/pleroma/web/activity_pub/activity_pub_controller.ex
b/lib/pleroma/web/activity_pub/activity_pub_controller.ex
index 5a41dac5c70f885704057d815f94c4b1789c6a32..b624d4255c0f631833e951bd8ddb1c15ad00080b 100644
(file)
--- a/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
+++ b/
lib/pleroma/web/activity_pub/activity_pub_controller.ex
@@
-21,6
+21,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
alias Pleroma.Web.ActivityPub.UserView
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
alias Pleroma.Web.ActivityPub.UserView
alias Pleroma.Web.ActivityPub.Utils
alias Pleroma.Web.ActivityPub.Visibility
+ alias Pleroma.Web.ControllerHelper
alias Pleroma.Web.Endpoint
alias Pleroma.Web.FederatingPlug
alias Pleroma.Web.Federator
alias Pleroma.Web.Endpoint
alias Pleroma.Web.FederatingPlug
alias Pleroma.Web.Federator
@@
-102,8
+103,8
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
conn
end
conn
end
- def activity(conn,
%{"uuid" => uuid}
) do
- with ap_id <-
o_status_url(conn, :activity, uuid)
,
+ def activity(conn,
_params
) do
+ with ap_id <-
Endpoint.url() <> conn.request_path
,
%Activity{} = activity <- Activity.normalize(ap_id),
{_, true} <- {:public?, Visibility.is_public?(activity)} do
conn
%Activity{} = activity <- Activity.normalize(ap_id),
{_, true} <- {:public?, Visibility.is_public?(activity)} do
conn
@@
-251,6
+252,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|> put_view(UserView)
|> render("activity_collection_page.json", %{
activities: activities,
|> put_view(UserView)
|> render("activity_collection_page.json", %{
activities: activities,
+ pagination: ControllerHelper.get_pagination_fields(conn, activities, %{"limit" => "10"}),
iri: "#{user.ap_id}/outbox"
})
end
iri: "#{user.ap_id}/outbox"
})
end
@@
-368,6
+370,7
@@
defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|> put_view(UserView)
|> render("activity_collection_page.json", %{
activities: activities,
|> put_view(UserView)
|> render("activity_collection_page.json", %{
activities: activities,
+ pagination: ControllerHelper.get_pagination_fields(conn, activities, %{"limit" => "10"}),
iri: "#{user.ap_id}/inbox"
})
end
iri: "#{user.ap_id}/inbox"
})
end