Ignore old messages

This commit is contained in:
Pedro Lopez
2019-02-17 23:24:54 -04:00
parent 9032025920
commit f585cc1c5a
2 changed files with 7 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ class Client extends EventEmitter {
}
await page.exposeFunction('onAddMessageEvent', msg => {
if (msg.id.fromMe) return;
if (msg.id.fromMe || !msg.isNewMsg) return;
this.emit(Events.MESSAGE_CREATE, new Message(this, msg));
});

View File

@@ -61,6 +61,12 @@ class Message extends Base {
static get WAppModel() {
return 'Msg';
}
static get extraFields() {
return [
'isNewMsg'
];
}
}
module.exports = Message;