Skip to content

Commit

Permalink
Refactor stripping colours from parseMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
martynsmith committed Nov 16, 2011
1 parent bd60d2c commit c3c9862
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/irc.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,15 +693,12 @@ Client.prototype._clearWhoisData = function(nick) { // {{{
* takes a raw "line" from the IRC server and turns it into an object with
* useful keys
*/
function parseMessage(rawLine, stripColors) { // {{{
function parseMessage(line, stripColors) { // {{{
var message = {};
var match;

var line;
if (stripColors) {
line = rawLine.replace(/[\x02\x1f\x16\x0f]|\x03\d{0,2}(?:,\d{0,2})?/g, "");
} else {
line = rawLine;
line = line.replace(/[\x02\x1f\x16\x0f]|\x03\d{0,2}(?:,\d{0,2})?/g, "");
}

// Parse prefix
Expand Down

0 comments on commit c3c9862

Please sign in to comment.