Handle disconnects from XMPP, which I guess I wasn't doing.

This commit is contained in:
Christopher Cookman 2026-08-13 15:17:29 -06:00
parent 1a49ebbc08
commit 2727180ea8

View file

@ -608,6 +608,18 @@ xmpp.on("status", (status) => {
}));
}
});
// If status is 'disconnect', attempt to reconnect after 5 seconds
if (status === 'disconnect') {
console.log(`${colors.yellow("[WARN]")} XMPP disconnected, attempting to reconnect in 5 seconds...`);
setTimeout(() => {
console.log(`${colors.yellow("[WARN]")} Attempting to reconnect to XMPP...`);
xmpp.start().catch((err) => {
console.log(`${colors.red("[ERROR]")} XMPP failed to start: ${err}.`);
setTimeout(start, 5000);
});
}, 5000);
}
});
xmpp.reconnect.on("reconnecting", () => {