Commit 088eb03b authored by JC Brand's avatar JC Brand

Immediately hide chat room on close.

Also, use sendPresence from latest strophe so that we have a timeout in case a
responding presence never comes.
parent 7ad39cfd
......@@ -876,30 +876,29 @@
* (String) exit_msg: Optional message to indicate your
* reason for leaving.
*/
this.hide();
this.occupantsview.model.reset();
this.occupantsview.model.browserStorage._clear();
if (!converse.connection.connected ||
this.model.get('connection_status') === Strophe.Status.DISCONNECTED) {
// Don't send out a stanza if we're not connected.
this.cleanup();
return;
}
var presenceid = converse.connection.getUniqueId();
var presence = $pres({
type: "unavailable",
id: presenceid,
from: converse.connection.jid,
to: this.getRoomJIDAndNick()
});
if (exit_msg !== null) {
presence.c("status", exit_msg);
}
converse.connection.addHandler(
converse.connection.sendPresence(
presence,
this.cleanup.bind(this),
this.cleanup.bind(this),
null, "presence", null, presenceid
2000
);
converse.connection.send(presence);
},
renderConfigurationForm: function (stanza) {
......
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