Skip to content

Commit

Permalink
Merge pull request #2022 from thelounge/xpaw/not-loggable-types
Browse files Browse the repository at this point in the history
Define which message types should not be logged
  • Loading branch information
astorije committed Feb 2, 2018
2 parents 6b02419 + 1fdd1ff commit ec70bd9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/models/chan.js
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions src/models/msg.js
Expand Up @@ -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 = {
Expand Down

0 comments on commit ec70bd9

Please sign in to comment.