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

More session fixes.

* Make sure to rebroadcast presence when logging in after having just
logged out.
* Remove roster contacts when logging out, to avoid artifacts when logging in
with a different account.
parent 26f6ec98
...@@ -579,7 +579,6 @@ ...@@ -579,7 +579,6 @@
}; };
this.logOut = function () { this.logOut = function () {
// TODO render the login form
converse.chatboxviews.closeAllChatBoxes(false); converse.chatboxviews.closeAllChatBoxes(false);
converse.clearSession(); converse.clearSession();
converse.connection.disconnect(); converse.connection.disconnect();
...@@ -1941,10 +1940,10 @@ ...@@ -1941,10 +1940,10 @@
*/ */
converse.roster = new converse.RosterContacts(); converse.roster = new converse.RosterContacts();
converse.roster.browserStorage = new Backbone.BrowserStorage[converse.storage]( converse.roster.browserStorage = new Backbone.BrowserStorage[converse.storage](
b64_sha1('converse.contacts-'+converse.bare_jid)); b64_sha1('converse.contacts-'+converse.jid));
var rostergroups = new converse.RosterGroups(); var rostergroups = new converse.RosterGroups();
rostergroups.browserStorage = new Backbone.BrowserStorage[converse.storage]( rostergroups.browserStorage = new Backbone.BrowserStorage[converse.storage](
b64_sha1('converse.roster.groups'+converse.bare_jid)); b64_sha1('converse.roster.groups'+converse.jid));
converse.rosterview = new converse.RosterView({model: rostergroups}); converse.rosterview = new converse.RosterView({model: rostergroups});
converse.rosterview.render().fetch().update(); converse.rosterview.render().fetch().update();
this.contactspanel.$el.append(converse.rosterview.$el); this.contactspanel.$el.append(converse.rosterview.$el);
...@@ -4542,6 +4541,8 @@ ...@@ -4542,6 +4541,8 @@
/* Remove those views which are only allowed with a valid /* Remove those views which are only allowed with a valid
* connection. * connection.
*/ */
converse.roster.remove(); // Removes roster contacts
converse.initial_presence_sent = false;
if (this.features) { if (this.features) {
this.features.off().remove(); this.features.off().remove();
} }
......
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