quickblox 2.17.16-logger → 2.17.18-logger
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/quickblox.js +11 -9
- package/quickblox.min.js +1 -1
- package/src/modules/chat/qbChat.js +7 -2
- package/src/qbConfig.js +1 -1
- package/src/qbStrophe.js +2 -5
|
@@ -39,7 +39,7 @@ function ChatProxy(service) {
|
|
|
39
39
|
*/
|
|
40
40
|
if (Utils.getEnv().browser) {
|
|
41
41
|
// strophe js
|
|
42
|
-
self.connection = Connection(self.
|
|
42
|
+
self.connection = Connection(self._OnLogListener);
|
|
43
43
|
|
|
44
44
|
/** Add extension methods to track handlers for removal on reconnect */
|
|
45
45
|
self.connection.XHandlerReferences = [];
|
|
@@ -295,7 +295,6 @@ function ChatProxy(service) {
|
|
|
295
295
|
* @memberOf QB.chat
|
|
296
296
|
**/
|
|
297
297
|
|
|
298
|
-
|
|
299
298
|
this._onMessage = function (stanza) {
|
|
300
299
|
var from = chatUtils.getAttr(stanza, 'from'),
|
|
301
300
|
to = chatUtils.getAttr(stanza, 'to'),
|
|
@@ -701,6 +700,12 @@ function ChatProxy(service) {
|
|
|
701
700
|
----------------------------------------------------------------------------- */
|
|
702
701
|
ChatProxy.prototype = {
|
|
703
702
|
|
|
703
|
+
_OnLogListener: function (message) {
|
|
704
|
+
if (typeof this.onLogListener === 'function') {
|
|
705
|
+
Utils.safeCallbackCall(this.onLogListener, message);
|
|
706
|
+
}
|
|
707
|
+
},
|
|
708
|
+
|
|
704
709
|
/**
|
|
705
710
|
* self.connection to the chat. {@link https://quickblox.com/developers/Web_XMPP_Chat_Sample#Login_to_Chat More info.}
|
|
706
711
|
* @memberof QB.chat
|
package/src/qbConfig.js
CHANGED
package/src/qbStrophe.js
CHANGED
|
@@ -13,16 +13,13 @@ require('./libs/strophe/strophe.umd.js');
|
|
|
13
13
|
var config = require('./qbConfig');
|
|
14
14
|
var chatPRTCL = config.chatProtocol;
|
|
15
15
|
var Utils = require('./qbUtils');
|
|
16
|
-
var QBModules = require('./qbMain');
|
|
17
16
|
|
|
18
17
|
function Connection(onLogListenerCallback) {
|
|
19
18
|
var protocol = chatPRTCL.active === 1 ? chatPRTCL.bosh : chatPRTCL.websocket;
|
|
20
19
|
var conn = new Strophe.Connection(protocol);
|
|
21
|
-
var onLogListener = config.debug
|
|
22
|
-
var chatLogger = Utils.QBLog;
|
|
20
|
+
var onLogListener = config.debug ? onLogListenerCallback : null;
|
|
23
21
|
var safeCallbackCall = function(message, data) {
|
|
24
|
-
onLogListener =
|
|
25
|
-
chatLogger = QBModules.getLogger();
|
|
22
|
+
onLogListener = config.debug ? onLogListenerCallback : null;
|
|
26
23
|
if (onLogListener && typeof onLogListener === 'function') {
|
|
27
24
|
Utils.safeCallbackCall(onLogListener,
|
|
28
25
|
'[QBChat][QBStrophe]' + message + data);
|