Skip to content
Browse files

Closes #87 - Don't send : on last argument unless necessary

  • Loading branch information...
1 parent 8a5d508 commit 886461c6a4f2d0d266967985b896079787079044 @martynsmith committed Jun 14, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 lib/irc.js
View
9 lib/irc.js
@@ -597,14 +597,15 @@ Client.prototype.disconnect = function ( message, callback ) { // {{{
self.conn.end();
}; // }}}
Client.prototype.send = function(command) { // {{{
- var args = [];
- for ( var k in arguments )
- args.push(arguments[k]);
- args[args.length-1] = ":" + args[args.length-1];
+ var args = Array.prototype.slice.call(arguments);
// Remove the command
args.shift();
+ 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(" "));

0 comments on commit 886461c

Please sign in to comment.
Something went wrong with that request. Please try again.