Permalink
Browse files

Switch to single-quote strings in most places; remove spaces in funct…

…ion calls.
  • Loading branch information...
1 parent 588ee85 commit b94830e39b2e9f508c49a370a127f8255d1d0fdc @akavlie committed Nov 30, 2011
Showing with 20 additions and 20 deletions.
  1. +20 −20 lib/irc.js
View
@@ -68,7 +68,7 @@ function Client(server, nick, opt) {
self.connect();
}
- self.addListener("raw", function (message) { // {{{
+ self.addListener('raw', function (message) { // {{{
switch ( message.command ) {
case "001":
// Set nick to whatever the server decided it really is
@@ -472,13 +472,13 @@ Client.prototype.connect = function ( retryCount, callback ) { // {{{
self.conn.setEncoding('utf-8');
if ( self.opt.password !== null ) {
- self.send( "PASS", self.opt.password );
+ self.send('PASS', self.opt.password);
}
util.log('Sending irc NICK/USER');
- self.send("NICK", self.opt.nick);
+ self.send('NICK', self.opt.nick);
self.nick = self.opt.nick;
- self.send("USER", self.opt.userName, 8, "*", self.opt.realName);
- self.emit("connect");
+ self.send('USER', self.opt.userName, 8, '*', self.opt.realName);
+ self.emit('connect');
} else {
// authorization failed
util.log(self.conn.authorizationError);
@@ -490,19 +490,19 @@ Client.prototype.connect = function ( retryCount, callback ) { // {{{
self.conn.requestedDisconnect = false;
self.conn.setTimeout(0);
self.conn.setEncoding('utf8');
- self.conn.addListener("connect", function () {
+ self.conn.addListener('connect', function() {
if ( self.opt.password !== null ) {
- self.send( "PASS", self.opt.password );
+ self.send('PASS', self.opt.password);
}
- self.send("NICK", self.opt.nick);
+ self.send('NICK', self.opt.nick);
self.nick = self.opt.nick;
- self.send("USER", self.opt.userName, 8, "*", self.opt.realName);
- self.emit("connect");
+ self.send('USER', self.opt.userName, 8, '*', self.opt.realName);
+ self.emit('connect');
});
var buffer = '';
- self.conn.addListener("data", function (chunk) {
+ self.conn.addListener('data', function (chunk) {
buffer += chunk;
- var lines = buffer.split("\r\n");
+ var lines = buffer.split('\r\n');
buffer = lines.pop();
lines.forEach(function (line) {
var message = parseMessage(line, self.opt.stripColors);
@@ -515,11 +515,11 @@ Client.prototype.connect = function ( retryCount, callback ) { // {{{
}
});
});
- self.conn.addListener("end", function() {
+ self.conn.addListener('end', function() {
if ( self.opt.debug )
util.log('Connection got "end" event');
});
- self.conn.addListener("close", function() {
+ self.conn.addListener('close', function() {
if ( self.opt.debug )
util.log('Connection got "close" event');
if ( self.conn.requestedDisconnect )
@@ -528,21 +528,21 @@ Client.prototype.connect = function ( retryCount, callback ) { // {{{
util.log('Disconnected: reconnecting');
if ( self.opt.retryCount !== null && retryCount >= self.opt.retryCount ) {
if ( self.opt.debug ) {
- util.log( 'Maximum retry count (' + self.opt.retryCount + ') reached. Aborting' );
+ util.log('Maximum retry count (' + self.opt.retryCount + ') reached. Aborting');
}
- self.emit( 'abort', self.opt.retryCount );
+ self.emit('abort', self.opt.retryCount);
return;
}
if ( self.opt.debug ) {
- util.log( 'Waiting ' + self.opt.retryDelay + 'ms before retrying' );
+ util.log('Waiting ' + self.opt.retryDelay + 'ms before retrying');
}
- setTimeout( function() {
+ setTimeout(function() {
self.connect( retryCount + 1 );
}, self.opt.retryDelay );
});
- self.conn.addListener("error", function(exception) {
- self.emit("netError", exception);
+ self.conn.addListener('error', function(exception) {
+ self.emit('netError', exception);
});
}; // }}}
Client.prototype.disconnect = function ( message, callback ) { // {{{

0 comments on commit b94830e

Please sign in to comment.