From a2fb939b5cec6c2e1f516958e9df4f879d008cd9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 28 Jun 2024 15:12:47 -0400 Subject: [PATCH] fix: wrong property name for OrderedCollection items --- src/activitypub/contexts.js | 6 +++++- src/controllers/activitypub/actors.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/activitypub/contexts.js b/src/activitypub/contexts.js index ebe3ddfe20..183d405fa6 100644 --- a/src/activitypub/contexts.js +++ b/src/activitypub/contexts.js @@ -30,11 +30,15 @@ Contexts.get = async (uid, id) => { Contexts.getItems = async (uid, id, root = true) => { winston.verbose(`[activitypub/context] Retrieving context ${id}`); - let { type, items, first, next } = await activitypub.get('uid', uid, id); + let { type, items, orderedItems, first, next } = await activitypub.get('uid', uid, id); if (!acceptableTypes.includes(type)) { return []; } + if (type.startsWith('Ordered')) { + items = orderedItems; + } + if (items) { items = (await Promise.all(items.map(async (item) => { const { type, id } = await activitypub.helpers.resolveLocalId(item); diff --git a/src/controllers/activitypub/actors.js b/src/controllers/activitypub/actors.js index bcd8709b74..dd562140b2 100644 --- a/src/controllers/activitypub/actors.js +++ b/src/controllers/activitypub/actors.js @@ -107,7 +107,7 @@ Actors.topic = async function (req, res, next) { }; if (items) { - object.items = items; + object.orderedItems = items; if (paginate) { object.partOf = `${nconf.get('url')}/topic/${req.params.tid}`;