Register presence and message handlers before getting the roster
Otherwise some presence notifications might be lost
This commit is contained in:
parent
9b9bf1ce89
commit
53359b7ddc
@ -1,6 +1,12 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.5.3 (Unreleased)
|
||||
------------------
|
||||
|
||||
- Register presence and message handlers before fetching the roster. Otherwise
|
||||
some presence notifications might be missed. [jcbrand]
|
||||
|
||||
0.5.2 (2013-08-05)
|
||||
------------------
|
||||
|
||||
|
26
converse.js
26
converse.js
@ -2626,18 +2626,20 @@
|
||||
$.proxy(this.roster.subscribeToSuggestedItems, this.roster),
|
||||
'http://jabber.org/protocol/rosterx', 'message', null);
|
||||
|
||||
this.connection.roster.get($.proxy(function (a) {
|
||||
this.connection.addHandler(
|
||||
$.proxy(function (presence) {
|
||||
this.presenceHandler(presence);
|
||||
return true;
|
||||
}, this.roster), null, 'presence', null);
|
||||
this.connection.addHandler(
|
||||
$.proxy(function (message) {
|
||||
this.chatboxes.messageReceived(message);
|
||||
return true;
|
||||
}, this), null, 'message', 'chat');
|
||||
}, this));
|
||||
this.connection.addHandler(
|
||||
$.proxy(function (presence) {
|
||||
this.presenceHandler(presence);
|
||||
return true;
|
||||
}, this.roster), null, 'presence', null);
|
||||
|
||||
this.connection.addHandler(
|
||||
$.proxy(function (message) {
|
||||
this.chatboxes.messageReceived(message);
|
||||
return true;
|
||||
}, this), null, 'message', 'chat');
|
||||
|
||||
this.connection.roster.get(function () {});
|
||||
|
||||
$(window).on("blur focus", $.proxy(function(e) {
|
||||
if ((this.windowState != e.type) && (e.type == 'focus')) {
|
||||
converse.clearMsgCounter();
|
||||
|
Loading…
Reference in New Issue
Block a user