mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-12-25 08:58:53 -05:00
Tidy up muc state on join/leave
This commit is contained in:
parent
2cfb7f32b6
commit
a2c2993012
@ -108,6 +108,8 @@ module.exports = HumanModel.define({
|
||||
if (!this.nick) {
|
||||
this.nick = me.jid.local;
|
||||
}
|
||||
this.messages.reset();
|
||||
this.resources.reset();
|
||||
client.joinRoom(this.jid, this.nick, {
|
||||
history: {
|
||||
maxstanzas: 50
|
||||
@ -116,6 +118,7 @@ module.exports = HumanModel.define({
|
||||
});
|
||||
},
|
||||
leave: function () {
|
||||
this.resources.reset();
|
||||
client.leaveRoom(this.jid, this.nick);
|
||||
}
|
||||
});
|
||||
|
@ -20,6 +20,7 @@ module.exports = BasePage.extend({
|
||||
this.listenTo(this, 'pageunloaded', this.handlePageUnloaded);
|
||||
|
||||
this.listenTo(this.model.messages, 'change', this.refreshModel);
|
||||
this.listenTo(this.model.messages, 'reset', this.resetMessages);
|
||||
|
||||
this.render();
|
||||
},
|
||||
@ -225,5 +226,8 @@ module.exports = BasePage.extend({
|
||||
refreshModel: function (model) {
|
||||
var existing = this.$('#chat' + model.cid);
|
||||
existing.replaceWith(model.partialTemplateHtml);
|
||||
},
|
||||
resetMessages: function () {
|
||||
this.$messageList.empty();
|
||||
}
|
||||
});
|
||||
|
@ -1,5 +1,5 @@
|
||||
CACHE MANIFEST
|
||||
# 0.0.1 1388621918000
|
||||
# 0.0.1 1388626859519
|
||||
|
||||
CACHE:
|
||||
/app.js
|
||||
|
Loading…
Reference in New Issue
Block a user