diff --git a/modules/userModule.js b/modules/userModule.js index 75fd21b0..f635d285 100644 --- a/modules/userModule.js +++ b/modules/userModule.js @@ -1715,6 +1715,10 @@ const userFunctions = ( bot ) => { //adds users who join the room to the user list if their not already on the list this.addUserToTheUsersList( userID, username ); + // if they;ve previously been in the room as a guest we won't have their name + // best update it from the raw data that was passed into this function to be sure + this.updateUsername( userID, username ); + //starts time for everyone that joins the room this.addUserJoinedTime( userID ); @@ -1729,6 +1733,12 @@ const userFunctions = ( bot ) => { this.addUserIsHere( userID ); }, + updateUsername: function ( userID, username ) { + if ( this.userExists( userID ) ) { + this.storeUserData( userID, "username", username ); + } + }, + isUserHere: function ( userID ) { if ( this.userExists( userID ) ) { return theUsersList[ this.getPositionOnUsersList( userID ) ][ 'here' ];