quickblox 2.17.8-logger → 2.17.10-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.8-logger",
4
+ "version": "2.17.10-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
@@ -44155,6 +44155,11 @@ ChatProxy.prototype = {
44155
44155
 
44156
44156
  reconnect: function () {
44157
44157
  Utils.QBLog('[QBChat]', 'Call reconnect ');
44158
+ if (typeof this.onLogListener === 'function') {
44159
+ Utils.safeCallbackCall(this.onLogListener,
44160
+ '[QBChat]' +'[SDK v'+config.version+']' + ' Call reconnect ' +
44161
+ chatUtils.getLocalTime());
44162
+ }
44158
44163
  clearInterval(this._checkConnectionTimer);
44159
44164
  this._checkConnectionTimer = undefined;
44160
44165
  this.muc.joinedRooms = {};
@@ -44162,7 +44167,7 @@ ChatProxy.prototype = {
44162
44167
 
44163
44168
  if (Utils.getEnv().browser) {
44164
44169
  this.connection.flush();
44165
- this.connection.disconnect('reconnect from SDK');//artik should be added reasone = 'reconnect from SDK'
44170
+ this.connection.disconnect('call Qb.chat.reconnect');//artik should be added reasone = 'reconnect from SDK'
44166
44171
  } else {
44167
44172
  this.Client.end();
44168
44173
  }
@@ -44539,6 +44544,11 @@ ChatProxy.prototype = {
44539
44544
  * */
44540
44545
  disconnect: function () {
44541
44546
  Utils.QBLog('[QBChat]', 'Call disconnect ');
44547
+ if (typeof this.onLogListener === 'function') {
44548
+ Utils.safeCallbackCall(this.onLogListener,
44549
+ '[QBChat]' +'[SDK v'+config.version+']' + ' Call disconnect ' +
44550
+ chatUtils.getLocalTime());
44551
+ }
44542
44552
  clearInterval(this._checkConnectionTimer);
44543
44553
  clearInterval(this._checkExpiredSessionTimer);
44544
44554
  this._checkConnectionTimer = undefined;
@@ -44549,7 +44559,7 @@ ChatProxy.prototype = {
44549
44559
 
44550
44560
  if (Utils.getEnv().browser) {
44551
44561
  this.connection.flush();
44552
- this.connection.disconnect('disconnect from SDK');//artik should add reason = 'disconnect from SDK'
44562
+ this.connection.disconnect('call QB.chat.disconnect');//artik should add reason = 'disconnect from SDK'
44553
44563
  if (this._checkConnectionPingTimer !== undefined) {
44554
44564
  Utils.QBLog('[QBChat]', 'Stop ping');
44555
44565
  clearInterval(this._checkConnectionPingTimer);
@@ -51484,7 +51494,7 @@ module.exports = StreamManagement;
51484
51494
  */
51485
51495
 
51486
51496
  var config = {
51487
- version: '2.17.8-logger',
51497
+ version: '2.17.10-logger',
51488
51498
  buildNumber: '1161',
51489
51499
  creds: {
51490
51500
  'appId': 0,
@@ -52197,78 +52207,69 @@ require('./libs/strophe/strophe.umd.js');
52197
52207
  var config = require('./qbConfig');
52198
52208
  var chatPRTCL = config.chatProtocol;
52199
52209
  var Utils = require('./qbUtils');
52200
- var QBChatModules = require('./modules/qbChat');
52210
+ var QBChatModules = require('./modules/chat/qbChat');
52201
52211
 
52202
52212
  function Connection(onLogListenerCallback) {
52203
- var protocol = chatPRTCL.active === 1 ? chatPRTCL.bosh : chatPRTCL.websocket;
52204
- var conn = new Strophe.Connection(protocol);
52205
- var onLogListener = onLogListenerCallback || QBChatModules.onLogListener;
52206
-
52207
- if (chatPRTCL.active === 1) {
52208
- conn.xmlInput = function(data) {
52209
- if (data.childNodes[0]) {
52210
- for (var i = 0, len = data.childNodes.length; i < len; i++) {
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
- }
52216
- }
52217
- }
52218
- };
52219
- conn.xmlOutput = function(data) {
52220
- if (data.childNodes[0]) {
52221
- for (var i = 0, len = data.childNodes.length; i < len; i++) {
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
- }
52227
- }
52228
- }
52229
- };
52230
- } else {
52231
- conn.xmlInput = function(data) {
52232
- Utils.QBLog('[QBChat]', 'RECV:', data);
52213
+ var protocol = chatPRTCL.active === 1 ? chatPRTCL.bosh : chatPRTCL.websocket;
52214
+ var conn = new Strophe.Connection(protocol);
52215
+ var onLogListener = config.debug? onLogListenerCallback || QBChatModules.onLogListener : null;
52216
+ var safeCallbackCall = function(message, data) {
52217
+ onLogListener = onLogListenerCallback || QBChatModules.onLogListener;
52233
52218
  if (onLogListener && typeof onLogListener === 'function') {
52234
52219
  Utils.safeCallbackCall(onLogListener,
52235
- '[QBChat][QBStrophe]' + 'RECV:' + data);
52220
+ '[QBChat][QBStrophe]' + message + data);
52236
52221
  }
52237
- try {
52238
- let parser = new DOMParser();
52239
- let xmlDoc = parser.parseFromString(data, 'text/xml');
52240
-
52241
- let errorElem = xmlDoc.getElementsByTagName('error');
52242
- if (errorElem.length > 0) {
52243
- let conditionElem = errorElem[0].getElementsByTagName('condition');
52244
- if (conditionElem.length > 0) {
52245
- let disconnectCondition = conditionElem[0].textContent;
52246
- console.log('Disconnect condition:', disconnectCondition);
52247
- if (onLogListener && typeof onLogListener === 'function') {
52248
- Utils.safeCallbackCall(onLogListener,
52249
- '[QBChat][QBStrophe]' + 'DISCONNECTED CONDITION: ' + disconnectCondition);
52250
- }
52222
+ };
52223
+
52224
+ if (chatPRTCL.active === 1) {
52225
+ conn.xmlInput = function(data) {
52226
+ if (data.childNodes[0]) {
52227
+ for (var i = 0, len = data.childNodes.length; i < len; i++) {
52228
+ Utils.QBLog('[QBChat]', 'RECV:', data.childNodes[i]);
52229
+ safeCallbackCall('RECV:', data.childNodes[i]);
52251
52230
  }
52252
52231
  }
52253
- } catch (e) {
52254
- console.error('Error parsing XML input:', e);
52255
- }
52256
- };
52257
- conn.xmlOutput = function(data) {
52258
- Utils.QBLog('[QBChat]', 'SENT:', data);
52259
- if (onLogListener && typeof onLogListener === 'function') {
52260
- Utils.safeCallbackCall(onLogListener,
52261
- '[QBChat][QBStrophe]' + 'SENT:' + data);
52262
- }
52263
- };
52264
- }
52232
+ };
52233
+ conn.xmlOutput = function(data) {
52234
+ if (data.childNodes[0]) {
52235
+ for (var i = 0, len = data.childNodes.length; i < len; i++) {
52236
+ Utils.QBLog('[QBChat]', 'SENT:', data.childNodes[i]);
52237
+ safeCallbackCall('SENT', data.childNodes[i]);
52238
+ }
52239
+ }
52240
+ };
52241
+ } else {
52242
+ conn.xmlInput = function(data) {
52243
+ Utils.QBLog('[QBChat]', 'RECV:', data);
52244
+ safeCallbackCall('RECV:', data);
52265
52245
 
52266
- return conn;
52246
+ try {
52247
+ let parser = new DOMParser();
52248
+ let xmlDoc = parser.parseFromString(data, 'text/xml');
52249
+ let errorElem = xmlDoc.getElementsByTagName('error');
52250
+ if (errorElem.length > 0) {
52251
+ let conditionElem = errorElem[0].getElementsByTagName('condition');
52252
+ if (conditionElem.length > 0) {
52253
+ let disconnectCondition = conditionElem[0].textContent;
52254
+ console.log('Disconnect condition:', disconnectCondition);
52255
+ safeCallbackCall('DISCONNECTED CONDITION:', disconnectCondition);
52256
+ }
52257
+ }
52258
+ } catch (e) {
52259
+ console.error('Error parsing XML input:', e);
52260
+ }
52261
+ };
52262
+ conn.xmlOutput = function(data) {
52263
+ Utils.QBLog('[QBChat]', 'SENT:', data);
52264
+ safeCallbackCall('SENT', data);
52265
+ };
52266
+ }
52267
+ return conn;
52267
52268
  }
52268
52269
 
52269
52270
  module.exports = Connection;
52270
52271
 
52271
- },{"./libs/strophe/strophe.umd.js":227,"./modules/qbChat":undefined,"./qbConfig":247,"./qbUtils":251}],251:[function(require,module,exports){
52272
+ },{"./libs/strophe/strophe.umd.js":227,"./modules/chat/qbChat":228,"./qbConfig":247,"./qbUtils":251}],251:[function(require,module,exports){
52272
52273
  (function (global){(function (){
52273
52274
  /* eslint no-console: 2 */
52274
52275