@ -1,12 +1,15 @@
function User ( socket , authenticatedDefault ) {
function User ( socket , authenticatedDefault ) {
this . registered = false
this . registered = false
this . authenticated = authenticatedDefault
this . authenticated = authenticatedDefault
this . nickname = ""
this . nickname = undefined
this . connection = socket
this . connection = socket
this . realname = ""
this . realname = ""
this . username = ""
this . username = ""
this . setNickname = function ( nickname ) {
this . setNickname = function ( nickname ) {
if ( this . nickname !== undefined ) {
this . sendRaw ( ` : ${ this . nickname } NICK ${ nickname } ` )
}
this . nickname = nickname
this . nickname = nickname
}
}
@ -26,12 +29,6 @@ function User(socket, authenticatedDefault) {
this . getAddress = function ( ) {
this . getAddress = function ( ) {
return this . connection . address ( ) . address
return this . connection . address ( ) . address
}
}
this . setNickname = function ( nickname ) {
this . nickname = nickname
}
this . setRealName = function ( realname ) {
this . realname = realname
}
this . closeConnection = function ( ) {
this . closeConnection = function ( ) {
this . connection . destroy ( )
this . connection . destroy ( )