Skip to content

Node.js based forum software built for the modern web

fix: getUserInfo internal method in topic events to not filter out uids because getUsersFields already does it

Julian Lamf7259ccb8b80
diff --git a/src/topics/events.js b/src/topics/events.js
index 68d26406a5..5e0368ae45 100644
--- a/src/topics/events.js
+++ b/src/topics/events.js
@@ -130,8 +130,8 @@ Events.get = async (tid, uid, reverse = false) => {
};
async function getUserInfo(uids) {
- uids = uids.filter((uid, idx) => !isNaN(parseInt(uid, 10)) && uids.indexOf(uid) === idx);
- const userData = await user.getUsersFields(uids, ['picture', 'username', 'userslug']);
+ uids = new Set(uids); // eliminate dupes
+ const userData = await user.getUsersFields(Array.from(uids), ['picture', 'username', 'userslug']);
const userMap = userData.reduce((memo, cur) => memo.set(cur.uid, cur), new Map());
userMap.set('system', {
system: true,