quickblox 2.17.6-logger → 2.17.8-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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "quickblox",
3
3
  "description": "QuickBlox JavaScript SDK",
4
- "version": "2.17.6-logger",
4
+ "version": "2.17.8-logger",
5
5
  "homepage": "https://quickblox.com/developers/Javascript",
6
6
  "main": "src/qbMain.js",
7
7
  "types": "quickblox.d.ts",
package/quickblox.js CHANGED
@@ -43352,12 +43352,12 @@ function ChatProxy(service) {
43352
43352
  }
43353
43353
 
43354
43354
  // MUC presences go here
43355
- if (xXMLNS && xXMLNS == "http://jabber.org/protocol/muc#user") {
43355
+ if (xXMLNS && xXMLNS == 'http://jabber.org/protocol/muc#user') {
43356
43356
  dialogId = self.helpers.getDialogIdFromNode(from);
43357
43357
  userId = self.helpers.getUserIdFromRoomJid(from);
43358
43358
 
43359
43359
  // KICK from dialog event
43360
- if (status && statusCode == "301") {
43360
+ if (status && statusCode == '301') {
43361
43361
  if (typeof self.onKickOccupant === 'function') {
43362
43362
  var actorElement = chatUtils.getElement(chatUtils.getElement(x, 'item'), 'actor');
43363
43363
  var initiatorUserJid = chatUtils.getAttr(actorElement, 'jid');
@@ -43813,7 +43813,7 @@ ChatProxy.prototype = {
43813
43813
  self.isConnected = false;
43814
43814
  self._isConnecting = false;
43815
43815
  self._chatPingFailedCounter = 0;
43816
- self._establishConnection(params);
43816
+ self._establishConnection(params,'CONNECTED have SDK ping failed');
43817
43817
  }
43818
43818
  } else {
43819
43819
  Utils.QBLog('[QBChat]',
@@ -43885,7 +43885,7 @@ ChatProxy.prototype = {
43885
43885
  self.connection.reset();
43886
43886
 
43887
43887
  // reconnect to chat and enable check connection
43888
- self._establishConnection(params);
43888
+ self._establishConnection(params,'DISCONNECTED');
43889
43889
 
43890
43890
  break;
43891
43891
  case Strophe.Status.ATTACHED:
@@ -44014,7 +44014,7 @@ ChatProxy.prototype = {
44014
44014
  self._isConnecting = false;
44015
44015
 
44016
44016
  // reconnect to chat and enable check connection
44017
- self._establishConnection(params);
44017
+ self._establishConnection(params,'NODE:DISCONNECTED');
44018
44018
  });
44019
44019
 
44020
44020
  self.Client.on('error', function () {
@@ -44096,39 +44096,39 @@ ChatProxy.prototype = {
44096
44096
  }
44097
44097
  },
44098
44098
 
44099
- _establishConnection: function (params) {
44099
+ _establishConnection: function (params, description) {
44100
44100
  var self = this;
44101
- Utils.QBLog('[QBChat]', '_establishConnection called');
44101
+ Utils.QBLog('[QBChat]', '_establishConnection called in ' + description);
44102
44102
  if (typeof self.onLogListener === 'function') {
44103
44103
  Utils.safeCallbackCall(self.onLogListener,
44104
- '[QBChat]' + '_establishConnection called');
44104
+ '[QBChat]' + '_establishConnection called in ' + description);
44105
44105
  }
44106
44106
  if (self._isLogout || self._checkConnectionTimer) {
44107
44107
  Utils.QBLog('[QBChat]', '_establishConnection return');
44108
44108
  if (typeof self.onLogListener === 'function') {
44109
44109
  Utils.safeCallbackCall(self.onLogListener,
44110
- '[QBChat]' + ' _establishConnection return with self._isLogout: '+
44111
- self._isLogout+' and self._checkConnectionTimer ' +self._checkConnectionTimer?'set up':'undefined');
44110
+ '[QBChat]' + 'BREAK _establishConnection RETURN with self._isLogout: '+
44111
+ self._isLogout?self._isLogout:'undefined'+' and self._checkConnectionTimer ' +self._checkConnectionTimer?self._checkConnectionTimer:'undefined');
44112
44112
  }
44113
44113
  return;
44114
44114
  }
44115
44115
 
44116
44116
  var _connect = function () {
44117
- Utils.QBLog('[QBChat]', 'call _connect() in _establishConnection ');
44117
+ Utils.QBLog('[QBChat]', 'call _connect() in _establishConnection in '+description);
44118
44118
  if (typeof self.onLogListener === 'function') {
44119
44119
  Utils.safeCallbackCall(self.onLogListener,
44120
- '[QBChat]' + ' call _connect() in _establishConnection ');
44120
+ '[QBChat]' + ' call _connect() in _establishConnection in '+description);
44121
44121
  }
44122
44122
  if (!self.isConnected && !self._isConnecting && !self._sessionHasExpired) {
44123
- Utils.QBLog('[QBChat]', ' start execute connect() in _establishConnection ');
44123
+ Utils.QBLog('[QBChat]', ' start EXECUTE connect() in _establishConnection ');
44124
44124
  if (typeof self.onLogListener === 'function') {
44125
44125
  Utils.safeCallbackCall(self.onLogListener,
44126
- '[QBChat]' + ' with statuses (!self.isConnected && !self._isConnecting && !self._sessionHasExpired): '+' self.isConnected: '+self.isConnected+' self._isConnecting: '+self._isConnecting+' self._sessionHasExpired: '+self._sessionHasExpired);
44126
+ '[QBChat]' + ' start EXECUTE connect() in _establishConnection in '+description+' self.isConnected: '+self.isConnected+' self._isConnecting: '+self._isConnecting+' self._sessionHasExpired: '+self._sessionHasExpired);
44127
44127
  }
44128
44128
  self.connect(params);
44129
44129
  if (typeof self.onLogListener === 'function') {
44130
44130
  Utils.safeCallbackCall(self.onLogListener,
44131
- '[QBChat]' + 'call _connect() in _establishConnection is executed');
44131
+ '[QBChat]' + 'call _connect() in _establishConnection in '+description+' is executed');
44132
44132
  }
44133
44133
  } else {
44134
44134
  Utils.QBLog('[QBChat]', 'stop timer in _establishConnection ');
@@ -44136,7 +44136,7 @@ ChatProxy.prototype = {
44136
44136
  self._checkConnectionTimer = undefined;
44137
44137
  if (typeof self.onLogListener === 'function') {
44138
44138
  Utils.safeCallbackCall(self.onLogListener,
44139
- '[QBChat]' + 'stop timer in _establishConnection ');
44139
+ '[QBChat]' + 'stop timer in _establishConnection in '+description);
44140
44140
  }
44141
44141
  }
44142
44142
  };
@@ -51484,7 +51484,7 @@ module.exports = StreamManagement;
51484
51484
  */
51485
51485
 
51486
51486
  var config = {
51487
- version: '2.17.6-logger',
51487
+ version: '2.17.8-logger',
51488
51488
  buildNumber: '1161',
51489
51489
  creds: {
51490
51490
  'appId': 0,
@@ -52197,16 +52197,22 @@ require('./libs/strophe/strophe.umd.js');
52197
52197
  var config = require('./qbConfig');
52198
52198
  var chatPRTCL = config.chatProtocol;
52199
52199
  var Utils = require('./qbUtils');
52200
+ var QBChatModules = require('./modules/qbChat');
52200
52201
 
52201
- function Connection(onLogListener) {
52202
+ function Connection(onLogListenerCallback) {
52202
52203
  var protocol = chatPRTCL.active === 1 ? chatPRTCL.bosh : chatPRTCL.websocket;
52203
52204
  var conn = new Strophe.Connection(protocol);
52205
+ var onLogListener = onLogListenerCallback || QBChatModules.onLogListener;
52204
52206
 
52205
52207
  if (chatPRTCL.active === 1) {
52206
52208
  conn.xmlInput = function(data) {
52207
52209
  if (data.childNodes[0]) {
52208
52210
  for (var i = 0, len = data.childNodes.length; i < len; i++) {
52209
52211
  Utils.QBLog('[QBChat]', 'RECV:', data.childNodes[i]);
52212
+ if (onLogListener && typeof onLogListener === 'function') {
52213
+ Utils.safeCallbackCall(onLogListener,
52214
+ '[QBChat][QBStrophe]' + 'RECV:' + data.childNodes[i]);
52215
+ }
52210
52216
  }
52211
52217
  }
52212
52218
  };
@@ -52214,13 +52220,20 @@ function Connection(onLogListener) {
52214
52220
  if (data.childNodes[0]) {
52215
52221
  for (var i = 0, len = data.childNodes.length; i < len; i++) {
52216
52222
  Utils.QBLog('[QBChat]', 'SENT:', data.childNodes[i]);
52223
+ if (onLogListener && typeof onLogListener === 'function') {
52224
+ Utils.safeCallbackCall(onLogListener,
52225
+ '[QBChat][QBStrophe]' + 'SENT:' + data.childNodes[i]);
52226
+ }
52217
52227
  }
52218
52228
  }
52219
52229
  };
52220
52230
  } else {
52221
52231
  conn.xmlInput = function(data) {
52222
52232
  Utils.QBLog('[QBChat]', 'RECV:', data);
52223
- //
52233
+ if (onLogListener && typeof onLogListener === 'function') {
52234
+ Utils.safeCallbackCall(onLogListener,
52235
+ '[QBChat][QBStrophe]' + 'RECV:' + data);
52236
+ }
52224
52237
  try {
52225
52238
  let parser = new DOMParser();
52226
52239
  let xmlDoc = parser.parseFromString(data, 'text/xml');
@@ -52240,10 +52253,13 @@ function Connection(onLogListener) {
52240
52253
  } catch (e) {
52241
52254
  console.error('Error parsing XML input:', e);
52242
52255
  }
52243
- //
52244
52256
  };
52245
52257
  conn.xmlOutput = function(data) {
52246
52258
  Utils.QBLog('[QBChat]', 'SENT:', data);
52259
+ if (onLogListener && typeof onLogListener === 'function') {
52260
+ Utils.safeCallbackCall(onLogListener,
52261
+ '[QBChat][QBStrophe]' + 'SENT:' + data);
52262
+ }
52247
52263
  };
52248
52264
  }
52249
52265
 
@@ -52252,7 +52268,7 @@ function Connection(onLogListener) {
52252
52268
 
52253
52269
  module.exports = Connection;
52254
52270
 
52255
- },{"./libs/strophe/strophe.umd.js":227,"./qbConfig":247,"./qbUtils":251}],251:[function(require,module,exports){
52271
+ },{"./libs/strophe/strophe.umd.js":227,"./modules/qbChat":undefined,"./qbConfig":247,"./qbUtils":251}],251:[function(require,module,exports){
52256
52272
  (function (global){(function (){
52257
52273
  /* eslint no-console: 2 */
52258
52274