Permalink
Browse files

replaced the split with a regex. This preserves IPv6 while not breaki…

…ng join-messages (see #91)
  • Loading branch information...
1 parent 2d127a6 commit af75124b18652ea7bbb14b8127fc545404791a32 @ccoenen committed Jun 20, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/irc.js
View
@@ -779,10 +779,10 @@ function parseMessage(line, stripColors) { // {{{
var middle, trailing;
// Parse parameters
- if ( line.indexOf(' :') != -1 ) {
- var index = line.indexOf(' :');
- middle = line.substr(0, index).replace(/ +$/, "");
- trailing = line.substr(index+2);
+ if ( line.indexOf(':') != -1 ) {
+ match = line.match(/(.*)(?:^:|\s+:)(.*)/);
+ middle = match[1].trimRight();
+ trailing = match[2];
}
else {
middle = line;

0 comments on commit af75124

Please sign in to comment.