From 400cfa38a7e894c7c922f6199d8156380724d4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Cargo=C3=ABt?= Date: Wed, 1 Apr 2015 15:20:46 +0200 Subject: [PATCH] Fix the ChatRoomOccupants storage id --- converse.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/converse.js b/converse.js index 7c5f36958..e69d9dcd3 100644 --- a/converse.js +++ b/converse.js @@ -2188,11 +2188,7 @@ }); this.ChatRoomOccupants = Backbone.Collection.extend({ - model: converse.ChatRoomOccupant, - initialize: function (options) { - this.browserStorage = new Backbone.BrowserStorage[converse.storage]( - b64_sha1('converse.occupants'+converse.bare_jid+options.nick)); - } + model: converse.ChatRoomOccupant }); this.ChatRoomOccupantsView = Backbone.Overview.extend({ @@ -2350,6 +2346,10 @@ this.occupantsview = new converse.ChatRoomOccupantsView({ model: new converse.ChatRoomOccupants({nick: this.model.get('nick')}) }); + var id = b64_sha1('converse.occupants'+converse.bare_jid+this.model.get('id')+this.model.get('nick')); + this.occupantsview.model.id = id; // Appears to be necessary for backbone.browserStorage + this.occupantsview.model.browserStorage = new Backbone.BrowserStorage[converse.storage](id); + this.occupantsview.chatroomview = this; this.render(); this.occupantsview.model.fetch({add:true});