Permalink
Browse files

Don't fail if send is called with a command and no other arguments

  • Loading branch information...
1 parent b8298f2 commit b30e1f6e22cb0fabd1125afdb0fecce3f23f646c @martynsmith committed Nov 3, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 lib/irc.js
View
@@ -687,18 +687,17 @@ Client.prototype.disconnect = function ( message, callback ) { // {{{
Client.prototype.send = function(command) { // {{{
var args = Array.prototype.slice.call(arguments);
- // Remove the command
- args.shift();
+ // Note that the command arg is included in the args array as the first element
if ( args[args.length-1].match(/\s/) ) {
args[args.length-1] = ":" + args[args.length-1];
}
if ( this.opt.debug )
- util.log('SEND: ' + command + " " + args.join(" "));
+ util.log('SEND: ' + args.join(" "));
if ( ! this.conn.requestedDisconnect ) {
- this.conn.write(command + " " + args.join(" ") + "\r\n");
+ this.conn.write(args.join(" ") + "\r\n");
}
}; // }}}
Client.prototype.activateFloodProtection = function(interval) { // {{{

0 comments on commit b30e1f6

Please sign in to comment.