Permalink
Browse files

Fixes ipv6 and doesn't screw up privmsgs with colons

  • Loading branch information...
1 parent 73fea61 commit 321e527764906e146f70681654265c08967d68a9 @rickihastings rickihastings committed Jan 5, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/irc.js
View
@@ -861,7 +861,7 @@ function parseMessage(line, stripColors) { // {{{
message.command = match[1];
message.rawCommand = match[1];
message.commandType = 'normal';
- line = line.replace(/^[^ ]+ +/, '');
+ line = ' ' + line.replace(/^[^ ]+ +/, '');
if ( replyFor[message.rawCommand] ) {
message.command = replyFor[message.rawCommand].name;
@@ -872,13 +872,13 @@ function parseMessage(line, stripColors) { // {{{
var middle, trailing;
// Parse parameters
- if ( line.indexOf(':') != -1 ) {
- match = line.match(/(.*)(?:^:|\s+:)(.*)/);
- middle = match[1].trimRight();
- trailing = match[2];
+ if (line.indexOf(' :') != -1) {
+ var index = line.indexOf(' :');
+ middle = line.substr(0, index).trim();
+ trailing = line.substr(index + 2);
}
else {
- middle = line;
+ middle = line.replace(/^[^ ]+ +/, '');
}
if ( middle.length )

0 comments on commit 321e527

Please sign in to comment.