[core] Handle keep alive restored
This commit is contained in:
1 parent
8bc3489060
commit
530dfa758f
1 file changed
+6
@@ -86,6 +86,7 @@ enum WhatsMeowEvent {
|
||||
CONNECTED = 'gows.ConnectedEventData',
|
||||
DISCONNECTED = 'events.Disconnected',
|
||||
KEEP_ALIVE_TIMEOUT = 'events.KeepAliveTimeout',
|
||||
KEEP_ALIVE_RESTORED = 'events.KeepAliveRestored',
|
||||
QR_CHANNEL_ITEM = 'whatsmeow.QRChannelItem',
|
||||
MESSAGE = 'events.Message',
|
||||
RECEIPT = 'events.Receipt',
|
||||
@@ -215,6 +216,11 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
this.status = WAHASessionStatus.STARTING;
|
||||
}
|
||||
});
|
||||
events.on(WhatsMeowEvent.KEEP_ALIVE_RESTORED, () => {
|
||||
if (this.status != WAHASessionStatus.WORKING) {
|
||||
this.status = WAHASessionStatus.WORKING;
|
||||
}
|
||||
});
|
||||
events.on(WhatsMeowEvent.QR_CHANNEL_ITEM, async (data) => {
|
||||
if (!data.Event) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user