Permalink
Browse files

Fix for receiving messages with colons

This fixes issues #122, #128 and #133.

Example lines include:
    :some.irc.net 324 webuser #channel +Cnj 5:10
    :nick!user@host QUIT :Ping timeout: 252 seconds
    :nick!user@host PRIVMSG #channel :so : colons: :are :: not a problem ::::
  • Loading branch information...
1 parent 3588438 commit af6f07f3f040f753851419c5582463b06b0cf2ba @qsheets qsheets committed Jan 19, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/irc.js
View
@@ -872,8 +872,8 @@ function parseMessage(line, stripColors) { // {{{
var middle, trailing;
// Parse parameters
- if ( line.indexOf(':') != -1 ) {
- match = line.match(/(.*)(?:^:|\s+:)(.*)/);
+ if ( line.search(/^:|\s+:/) != -1 ) {
+ match = line.match(/(.*?)(?:^:|\s+:)(.*)/);
middle = match[1].trimRight();
trailing = match[2];
}

0 comments on commit af6f07f

Please sign in to comment.