Skip to content

Node.js based forum software built for the modern web

fix: always send replies uri instead of null if no replies exist, @trwnh

Julian Lamff08fbb73fa5
diff --git a/src/activitypub/helpers.js b/src/activitypub/helpers.js
index f27a1a5d60..f46d2644c9 100644
--- a/src/activitypub/helpers.js
+++ b/src/activitypub/helpers.js
@@ -398,6 +398,8 @@ Helpers.generateCollection = async ({ set, method, page, perPage, url }) => {
object.next = page < pageCount ? `${url}?page=${page + 1}` : null;
object.prev = page > 1 ? `${url}?page=${page - 1}` : null;
}
+ } else {
+ object.orderedItems = [];
}
if (paginate) {
diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js
index 144efa51f2..dad00dce6d 100644
--- a/src/activitypub/mocks.js
+++ b/src/activitypub/mocks.js
@@ -386,8 +386,6 @@ Mocks.note = async (post) => {
return payload;
});
- const replyCount = await db.sortedSetCard(`pid:${post.pid}:replies`);
-
const object = {
'@context': 'https://www.w3.org/ns/activitystreams',
id,
@@ -407,7 +405,7 @@ Mocks.note = async (post) => {
source,
tag,
attachment,
- replies: replyCount > 0 ? `${id}/replies` : null,
+ replies: `${id}/replies`,
};
return object;