Commit 84bde6e7 authored by JC Brand's avatar JC Brand

Move some `close` logic to the model

parent 0426898c
...@@ -1218,11 +1218,7 @@ converse.plugins.add('converse-chatview', { ...@@ -1218,11 +1218,7 @@ converse.plugins.add('converse-chatview', {
this.setChatState(_converse.INACTIVE); this.setChatState(_converse.INACTIVE);
this.model.sendChatState(); this.model.sendChatState();
} }
try { this.model.close();
this.model.destroy();
} catch (e) {
_converse.log(e, Strophe.LogLevel.ERROR);
}
this.remove(); this.remove();
/** /**
* Triggered once a chatbox has been closed. * Triggered once a chatbox has been closed.
......
...@@ -325,6 +325,14 @@ converse.plugins.add('converse-chatboxes', { ...@@ -325,6 +325,14 @@ converse.plugins.add('converse-chatboxes', {
}); });
}, },
close () {
try {
this.destroy();
} catch (e) {
_converse.log(e, Strophe.LogLevel.ERROR);
}
},
validate (attrs, options) { validate (attrs, options) {
const { _converse } = this.__super__; const { _converse } = this.__super__;
if (!attrs.jid) { if (!attrs.jid) {
......
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