Skip to content

Node.js based forum software built for the modern web

fix: issue where incrementing user hash fields didn't use the right key name for remote announce @barisusakli

Julian Lame84cfd8c0767
diff --git a/src/user/data.js b/src/user/data.js
index 1b5e5b2ea9..162a65317f 100644
--- a/src/user/data.js
+++ b/src/user/data.js
@@ -383,7 +383,8 @@ module.exports = function (User) {
};
async function incrDecrUserFieldBy(uid, field, value, type) {
- const newValue = await db.incrObjectFieldBy(`user:${uid}`, field, value);
+ const prefix = `user${activitypub.helpers.isUri(uid) ? 'Remote' : ''}`;
+ const newValue = await db.incrObjectFieldBy(`${prefix}:${uid}`, field, value);
plugins.hooks.fire('action:user.set', { uid: uid, field: field, value: newValue, type: type });
return newValue;
}