Ignore old messages
This commit is contained in:
parent
9032025920
commit
f585cc1c5a
2 changed files with 7 additions and 1 deletions
|
|
@ -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));
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@ class Message extends Base {
|
|||
static get WAppModel() {
|
||||
return 'Msg';
|
||||
}
|
||||
|
||||
static get extraFields() {
|
||||
return [
|
||||
'isNewMsg'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Message;
|
||||
Loading…
Reference in a new issue