aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/whatsapp.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/whatsapp.rs b/src/whatsapp.rs
index bed72a1..285caeb 100644
--- a/src/whatsapp.rs
+++ b/src/whatsapp.rs
@@ -678,6 +678,15 @@ impl WhatsappManager {
self.conn.disable();
}
}
+ if let WaError::StatusCode(sc) = err {
+ if sc == 401 {
+ warn!("Disconnected from WhatsApp due to 401");
+ let err = "Error: WhatsApp Web credentials are invalid. Use the WHATSAPP SETUP command to restore connectivity.";
+ self.cb_tx.unbounded_send(ControlBotCommand::ReportFailure(err.into()))
+ .unwrap();
+ self.conn.disable();
+ }
+ }
self.our_jid = None;
self.connected = false;
}