Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions js/modules/qbChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,22 @@ function ChatProxy(service, webrtcModule, conn) {

return true;
};

this._onMessageErrorListener = function(stanza) {
console.log(stanza);
var type = stanza.getAttribute('type'),
error = stanza.querySelector('text').textContent;

// fire 'onMessageErrorListener'
//
if (typeof self.onMessageErrorListener === 'function' && type === 'error') {
Utils.safeCallbackCall(self.onMessageErrorListener, messageId, error);
}

// we must return true to keep the handler alive
// returning false would remove it after it finishes
return true;
};
}


Expand Down Expand Up @@ -332,6 +348,7 @@ ChatProxy.prototype = {
connection.addHandler(self._onPresence, null, 'presence');
connection.addHandler(self._onIQ, null, 'iq');
connection.addHandler(self._onSystemMessageListener, null, 'message', 'headline');
connection.addHandler(self._onMessageErrorListener, null, 'message', 'error');

// set signaling callbacks
connection.addHandler(webrtc._onMessage, null, 'message', 'headline');
Expand Down
Loading