This commit is contained in:
Hri7566 2021-04-13 17:50:06 -04:00
parent 274d345235
commit 0efba56390
1 changed files with 1 additions and 3 deletions

View File

@ -189,13 +189,11 @@ module.exports = (cl) => {
if (msg.set.name.length > 40) return; if (msg.set.name.length > 40) return;
if(!cl.quotas.userset.attempt()) return; if(!cl.quotas.userset.attempt()) return;
cl.user.name = msg.set.name; cl.user.name = msg.set.name;
let data = Database.getUserData(cl, cl.server);
let user = new User(cl, data);
Database.getUserData(cl, cl.server).then((usr) => { Database.getUserData(cl, cl.server).then((usr) => {
let dbentry = Database.userdb.get(cl.user._id); let dbentry = Database.userdb.get(cl.user._id);
if (!dbentry) return; if (!dbentry) return;
dbentry.name = msg.set.name; dbentry.name = msg.set.name;
user.updatedb(); Database.update();
cl.server.rooms.forEach((room) => { cl.server.rooms.forEach((room) => {
room.updateParticipant(cl.user._id, { room.updateParticipant(cl.user._id, {
name: msg.set.name name: msg.set.name