Define which message types should not be logged

This commit is contained in:
Pavel Djundik 2018-01-31 10:56:06 +02:00
parent 93265ef830
commit 1fdd1ff0c3
2 changed files with 10 additions and 0 deletions

View file

@ -174,6 +174,10 @@ Chan.prototype.getFilteredClone = function(lastActiveChannel, lastMessage) {
};
function writeUserLog(client, msg) {
if (!msg.isLoggable()) {
return false;
}
const target = client.find(this.id);
if (!target) {

View file

@ -37,6 +37,12 @@ class Msg {
findPreview(link) {
return this.previews.find((preview) => preview.link === link);
}
isLoggable() {
return this.type !== Msg.Type.MOTD &&
this.type !== Msg.Type.BANLIST &&
this.type !== Msg.Type.WHOIS;
}
}
Msg.Type = {