Skip to content

Commit 3f3b482

Browse files
author
Igor Khomenko
committed
Merge pull request #85 from QuickBlox/develop.chat.privacylist
Develop.chat.privacylist
2 parents d7176bc + 5f6b2fa commit 3f3b482

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

js/modules/qbChat.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,22 @@ function ChatProxy(service, webrtcModule, conn) {
275275

276276
return true;
277277
};
278+
279+
this._onMessageErrorListener = function(stanza) {
280+
console.log(stanza);
281+
var type = stanza.getAttribute('type'),
282+
error = stanza.querySelector('text').textContent;
283+
284+
// fire 'onMessageErrorListener'
285+
//
286+
if (typeof self.onMessageErrorListener === 'function' && type === 'error') {
287+
Utils.safeCallbackCall(self.onMessageErrorListener, messageId, error);
288+
}
289+
290+
// we must return true to keep the handler alive
291+
// returning false would remove it after it finishes
292+
return true;
293+
};
278294
}
279295

280296

@@ -332,6 +348,7 @@ ChatProxy.prototype = {
332348
connection.addHandler(self._onPresence, null, 'presence');
333349
connection.addHandler(self._onIQ, null, 'iq');
334350
connection.addHandler(self._onSystemMessageListener, null, 'message', 'headline');
351+
connection.addHandler(self._onMessageErrorListener, null, 'message', 'error');
335352

336353
// set signaling callbacks
337354
connection.addHandler(webrtc._onMessage, null, 'message', 'headline');

0 commit comments

Comments
 (0)