Fix issues with chat logging after chat format refactoring

- Fix '<username.undefined>' in log
- Fix channel log filter
This commit is contained in:
calzoneman 2013-11-20 10:10:01 -06:00
parent dfa454618a
commit 85e413bcdf
2 changed files with 2 additions and 13 deletions

View File

@ -2258,17 +2258,6 @@ Channel.prototype.tryChat = function(user, data) {
}
}
Channel.prototype.chainMessage = function(user, msg, data) {
if(msg.indexOf("/") == 0)
ChatCommand.handle(this, user, msg, data);
else if(msg.indexOf(">") == 0)
this.sendMessage(user.name, msg, "greentext", data);
else
this.sendMessage(user.name, msg, "", data);
}
Channel.prototype.filterMessage = function(msg) {
const link = /(\w+:\/\/(?:[^:\/\[\]\s]+|\[[0-9a-f:]+\])(?::\d+)?(?:\/[^\/\s]*)*)/ig;
var subs = msg.split(link);
@ -2318,7 +2307,7 @@ Channel.prototype.sendMessage = function (user, msg, meta, filter) {
if(this.chatbuffer.length > 15)
this.chatbuffer.shift();
var unescaped = sanitize(msg).entityDecode();
this.logger.log("<" + user.name + (meta.addClass ? "." + meta.addclass : "")
this.logger.log("<" + user.name + (meta.addClass ? "." + meta.addClass : "")
+ "> " + unescaped);
}
};

View File

@ -1889,7 +1889,7 @@ function filterChannelLog() {
return;
}
if (chat && pre.match(/<[\w-]+\.>/)) {
if (chat && pre.match(/<[\w-]+(\.\w*)?>/)) {
include.push(line);
return;
}