|
@@ -43,7 +43,6 @@
|
|
//
|
|
//
|
|
// New functions which don't exist yet can also be added.
|
|
// New functions which don't exist yet can also be added.
|
|
afterReconnected: function () {
|
|
afterReconnected: function () {
|
|
- this.rosterview.registerRosterXHandler();
|
|
|
|
this.__super__.afterReconnected.apply(this, arguments);
|
|
this.__super__.afterReconnected.apply(this, arguments);
|
|
},
|
|
},
|
|
|
|
|
|
@@ -271,8 +270,6 @@
|
|
id: 'converse-roster',
|
|
id: 'converse-roster',
|
|
|
|
|
|
initialize: function () {
|
|
initialize: function () {
|
|
- this.roster_handler_ref = this.registerRosterHandler();
|
|
|
|
- this.rosterx_handler_ref = this.registerRosterXHandler();
|
|
|
|
_converse.roster.on("add", this.onContactAdd, this);
|
|
_converse.roster.on("add", this.onContactAdd, this);
|
|
_converse.roster.on('change', this.onContactChange, this);
|
|
_converse.roster.on('change', this.onContactChange, this);
|
|
_converse.roster.on("destroy", this.update, this);
|
|
_converse.roster.on("destroy", this.update, this);
|
|
@@ -326,13 +323,6 @@
|
|
}
|
|
}
|
|
}, 100),
|
|
}, 100),
|
|
|
|
|
|
- unregisterHandlers: function () {
|
|
|
|
- _converse.connection.deleteHandler(this.roster_handler_ref);
|
|
|
|
- delete this.roster_handler_ref;
|
|
|
|
- _converse.connection.deleteHandler(this.rosterx_handler_ref);
|
|
|
|
- delete this.rosterx_handler_ref;
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
update: _.debounce(function () {
|
|
update: _.debounce(function () {
|
|
if (_.isNull(this.roster.parentElement)) {
|
|
if (_.isNull(this.roster.parentElement)) {
|
|
this.$el.append(this.$roster.show());
|
|
this.$el.append(this.$roster.show());
|
|
@@ -385,31 +375,6 @@
|
|
return this;
|
|
return this;
|
|
},
|
|
},
|
|
|
|
|
|
- registerRosterHandler: function () {
|
|
|
|
- _converse.connection.addHandler(
|
|
|
|
- _converse.roster.onRosterPush.bind(_converse.roster),
|
|
|
|
- Strophe.NS.ROSTER, 'iq', "set"
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- registerRosterXHandler: function () {
|
|
|
|
- var t = 0;
|
|
|
|
- _converse.connection.addHandler(
|
|
|
|
- function (msg) {
|
|
|
|
- window.setTimeout(
|
|
|
|
- function () {
|
|
|
|
- _converse.connection.flush();
|
|
|
|
- _converse.roster.subscribeToSuggestedItems.bind(_converse.roster)(msg);
|
|
|
|
- },
|
|
|
|
- t
|
|
|
|
- );
|
|
|
|
- t += $(msg).find('item').length*250;
|
|
|
|
- return true;
|
|
|
|
- },
|
|
|
|
- Strophe.NS.ROSTERX, 'message', null
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
onGroupAdd: function (group) {
|
|
onGroupAdd: function (group) {
|
|
var view = new _converse.RosterGroupView({model: group});
|
|
var view = new _converse.RosterGroupView({model: group});
|
|
this.add(group.get('name'), view.render());
|
|
this.add(group.get('name'), view.render());
|