Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for receiving messages with colons #137

Merged
merged 1 commit into from

2 participants

@qsheets

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 ::::
@qsheets qsheets 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 ::::
af6f07f
@martynsmith martynsmith merged commit af6f07f into martynsmith:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 19, 2013
  1. @qsheets

    Fix for receiving messages with colons

    qsheets authored
    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 ::::
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/irc.js
View
4 lib/irc.js
@@ -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];
}
Something went wrong with that request. Please try again.