Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
proper state digest emitting
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Alabor committed Jan 11, 2015
1 parent fddb401 commit ac2e4cf
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/harmonyclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ function HarmonyClient(xmppClient) {
self._responseHandlerQueue = [];

function handleStanza(stanza) {
self._responseHandlerQueue.forEach(function(responseHandler, index, array) {

// Check for state digest:
var event = stanza.getChild('event');
if(event && event.attr('type') === 'connect.stateDigest?notify') {
onStateDigest.call(self, JSON.parse(event.getText()));
}
debug('handleStanza(' + stanza.toString() + ')');
// Check for state digest:
var event = stanza.getChild('event');
if(event && event.attr('type') === 'connect.stateDigest?notify') {
onStateDigest.call(self, JSON.parse(event.getText()));
}

// Check for queued response handlers:
// Check for queued response handlers:
self._responseHandlerQueue.forEach(function(responseHandler, index, array) {
if(responseHandler.canHandleStanza(stanza)) {
debug('received response stanza for queued response handler');

Expand Down

0 comments on commit ac2e4cf

Please sign in to comment.