Skip to content

Node.js based forum software built for the modern web

fix: wrong property name for OrderedCollection items

Julian Lama2fb939b5cec
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}`;