Merge pull request #2022 from thelounge/xpaw/not-loggable-types

Define which message types should not be logged
This commit is contained in:
Jérémie Astori 2018-02-02 00:47:07 -05:00 committed by GitHub
commit ec70bd91a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 = {