Commit 3514fdf4 authored by Eugene So's avatar Eugene So
Browse files

Fix handling of IRC color control sequences

An extra comma was being added after the control sequences
An empty color control sequence was not handled. It is supposed to
remove all color schemes.
parent a77e846b
......@@ -1109,7 +1109,7 @@ function Screen_print_line(line) {
codes.shift();
p2=codes[0];
codes.shift();
ending=","+codes.join(",");
ending=codes.join(",");
if(p2==undefined) {
p2="-1";
}
......@@ -1213,6 +1213,8 @@ function Screen_print_line(line) {
return ret+ending;
}
);
// Empty color code means remove all color formatting
line=line.replace(/\x03/g,DEFAULT_COLOR);
if(line.length > 78) {
// Word Wrap...
for(var j=0;j<=line.length;j++) {
......
var DEFAULT_COLOR= "\x01N\x01W";
var FROM_NICK_CURCHAN= "\x01N\x01B<\x01N\x01W%s\x01N\x01B>\x01N\x01W";
var FROM_NICK_OUTSIDE= "\x01N\x01B<\x01N\x01W%s\x01N\x01B>\x01N\x01W";
var JOIN_FORMAT= "\x01N\x01C%s (%s) has joined %s";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment