Use converse instead of this, to be more explicit.

This commit is contained in:
JC Brand 2016-09-21 11:48:53 +02:00
parent d8d1c283a7
commit 05a577059b

View File

@ -653,24 +653,24 @@
}; };
this.initRoster = function () { this.initRoster = function () {
this.roster = new this.RosterContacts(); converse.roster = new converse.RosterContacts();
this.roster.browserStorage = new Backbone.BrowserStorage.session( converse.roster.browserStorage = new Backbone.BrowserStorage.session(
b64_sha1('converse.contacts-'+this.bare_jid)); b64_sha1('converse.contacts-'+converse.bare_jid));
this.rostergroups = new converse.RosterGroups(); converse.rostergroups = new converse.RosterGroups();
this.rostergroups.browserStorage = new Backbone.BrowserStorage.session( converse.rostergroups.browserStorage = new Backbone.BrowserStorage.session(
b64_sha1('converse.roster.groups'+converse.bare_jid)); b64_sha1('converse.roster.groups'+converse.bare_jid));
}; };
this.unregisterPresenceHandler = function () { this.unregisterPresenceHandler = function () {
if (typeof this.presence_ref !== 'undefined') { if (typeof converse.presence_ref !== 'undefined') {
this.connection.deleteHandler(this.presence_ref); converse.connection.deleteHandler(converse.presence_ref);
delete this.presence_ref; delete converse.presence_ref;
} }
}; };
this.registerPresenceHandler = function () { this.registerPresenceHandler = function () {
this.unregisterPresenceHandler(); converse.unregisterPresenceHandler();
this.presence_ref = converse.connection.addHandler( converse.presence_ref = converse.connection.addHandler(
function (presence) { function (presence) {
converse.roster.presenceHandler(presence); converse.roster.presenceHandler(presence);
return true; return true;