summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-05-27 21:01:54 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-05-27 21:01:54 +0000
commita01093c505221d4a2ae2e0713680285348f4faf5 (patch)
treec23070805364e2e8af3f53a56cf66d01238a7b36
parentf34e22bba22e041a72ae379e3ac3807a00af9a8e (diff)
parentcd4352a86fe37983cbc617c42f3f6c8a631fb9b3 (diff)
Merge branch 'featured-totalItems' into 'develop'
Add missing totalItems field for featured collections See merge request pleroma/pleroma!3416
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/pleroma/web/activity_pub/views/user_view.ex3
-rw-r--r--test/pleroma/web/activity_pub/activity_pub_controller_test.exs2
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 61339a1aa..eacba0208 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Return OAuth token `id` (primary key) in POST `/oauth/token`.
- `AnalyzeMetadata` upload filter for extracting attachment dimensions and generating blurhashes.
- Attachment dimensions and blurhashes are federated when available.
+- Pinned posts federation
### Fixed
- Don't crash so hard when email settings are invalid.
diff --git a/lib/pleroma/web/activity_pub/views/user_view.ex b/lib/pleroma/web/activity_pub/views/user_view.ex
index 462f3b4a7..344da19d3 100644
--- a/lib/pleroma/web/activity_pub/views/user_view.ex
+++ b/lib/pleroma/web/activity_pub/views/user_view.ex
@@ -261,7 +261,8 @@ defmodule Pleroma.Web.ActivityPub.UserView do
%{
"id" => featured_address,
"type" => "OrderedCollection",
- "orderedItems" => objects
+ "orderedItems" => objects,
+ "totalItems" => length(objects)
}
|> Map.merge(Utils.make_json_ld_header())
end
diff --git a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
index cea4b3a97..c1e13c7cb 100644
--- a/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
+++ b/test/pleroma/web/activity_pub/activity_pub_controller_test.exs
@@ -1966,7 +1966,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubControllerTest do
%{nickname: nickname, featured_address: featured_address, pinned_objects: pinned_objects} =
refresh_record(user)
- %{"id" => ^featured_address, "orderedItems" => items} =
+ %{"id" => ^featured_address, "orderedItems" => items, "totalItems" => 2} =
conn
|> get("/users/#{nickname}/collections/featured")
|> json_response(200)