fix: Stop ack timer on connection drops

Fixes #17.
This commit is contained in:
PapaTutuWawa 2023-01-14 12:04:52 +01:00
parent ed49212f5a
commit ce3ea656ad

View File

@ -185,9 +185,18 @@ class StreamManagementManager extends XmppManagerBase {
_disableStreamManagement();
_streamResumed = false;
} else if (event is ConnectionStateChangedEvent) {
if (event.state == XmppConnectionState.connected) {
switch (event.state) {
case XmppConnectionState.connected:
// Push out all pending stanzas
await onStreamResumed(0);
break;
case XmppConnectionState.error:
case XmppConnectionState.notConnected:
_stopAckTimer();
break;
case XmppConnectionState.connecting:
// NOOP
break;
}
}
}