Commit 6dd4fc52 authored by JC Brand's avatar JC Brand

Tear down previous session when reconnecting anonymously

Because when we reconnect anonymously, we get a new JID, so it's as if
it's a completely new user.
parent a1d7076e
......@@ -1388,6 +1388,8 @@ _converse.api = {
// When reconnecting anonymously, we need to connect with only
// the domain, not the full JID that we had in our previous
// (now failed) session.
tearDown();
clearSession();
await setUserJID(_converse.settings.jid);
} else {
await setUserJID(_converse.bare_jid);
......@@ -1401,6 +1403,8 @@ _converse.api = {
// When reconnecting anonymously, we need to connect with only
// the domain, not the full JID that we had in our previous
// (now failed) session.
tearDown();
clearSession();
await setUserJID(_converse.settings.jid);
}
if ([Strophe.Status.RECONNECTING, Strophe.Status.CONNFAIL].includes(conn_status)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment