mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: updating of post counts for remote users
This commit is contained in:
@@ -111,7 +111,7 @@ module.exports = function (User) {
|
|||||||
if (uids.length) {
|
if (uids.length) {
|
||||||
const counts = await db.sortedSetsCard(uids.map(uid => `uid:${uid}:posts`));
|
const counts = await db.sortedSetsCard(uids.map(uid => `uid:${uid}:posts`));
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
db.setObjectBulk(uids.map((uid, index) => ([`user:${uid}`, { postcount: counts[index] }]))),
|
db.setObjectBulk(uids.map((uid, index) => ([`user${activitypub.helpers.isUri(uid) ? 'Remote' : ''}:${uid}`, { postcount: counts[index] }]))),
|
||||||
db.sortedSetAdd('users:postcount', counts, uids),
|
db.sortedSetAdd('users:postcount', counts, uids),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user