Changing the clients username will trigger a userupdate

This commit is contained in:
hydrabolt
2015-08-20 19:33:32 +01:00
parent be787e0951
commit 68db1f6ac0
4 changed files with 31 additions and 3 deletions

View File

@@ -535,8 +535,9 @@ exports.Client.prototype.connectWebsocket = function( cb ) {
} else if ( dat.t === "USER_UPDATE" ) {
if ( dat.d.id === self.user.id ) {
self.user.username = dat.d.username;
self.user.avatar = dat.d.avatar;
var newUsr = new User(dat.d);
self.triggerEvent("userupdate", [self.user, newUsr]);
self.user = newUsr;
}
}