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

This commit is contained in:
Julian Lam
2024-07-09 14:01:57 -04:00
parent b0eec67d78
commit e84cfd8c07

View File

@@ -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;
}