displayname fix

main
jerl 2024-06-04 12:00:13 -07:00
parent 1e40cc1039
commit f34099de9c
1 changed files with 9 additions and 1 deletions

View File

@ -157,7 +157,15 @@ async function authorize_key(msg, respond) {
}
async function update_user(msg, respond) {
await db.query(`update user set displayname = ?`, msg.displayname);
if ((await db.query(
`update user set displayname = ?
where name = ?
returning id`,
[msg.displayname, msg.auth_user.name])).rows.length === 0)
return respond({
success: false,
message: 'user not found'
});
vybe.users[msg.auth_user.name].displayname = msg.displayname;
respond({
success: true