quickblox 2.15.0 → 2.15.1
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/README.md +1 -1
- package/package.json +1 -1
- package/quickblox.js +80 -20
- package/quickblox.min.js +1 -1
- package/src/modules/chat/qbChat.js +76 -17
- package/src/qbConfig.js +2 -3
- package/src/qbProxy.js +2 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Check out our [API Reference](https://quickblox.github.io/quickblox-javascript-s
|
|
|
16
16
|
## Dependencies for browser
|
|
17
17
|
|
|
18
18
|
```html
|
|
19
|
-
<script src="https://unpkg.com/quickblox@2.15.
|
|
19
|
+
<script src="https://unpkg.com/quickblox@2.15.1/quickblox.min.js"></script>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Bower and RequireJS
|
package/package.json
CHANGED
package/quickblox.js
CHANGED
|
@@ -46246,20 +46246,10 @@ ChatProxy.prototype = {
|
|
|
46246
46246
|
' error: ', error);
|
|
46247
46247
|
self._localPingFaildCounter += 1;
|
|
46248
46248
|
if (self._localPingFaildCounter > 6) {
|
|
46249
|
-
|
|
46250
|
-
self.
|
|
46251
|
-
|
|
46252
|
-
|
|
46253
|
-
'connection failed, at ', Utils.getCurrentTime());
|
|
46254
|
-
}, function () {
|
|
46255
|
-
console.log("call _establishConnection ....");
|
|
46256
|
-
|
|
46257
|
-
self.isConnected = false;
|
|
46258
|
-
self._isConnecting = false;
|
|
46259
|
-
self._localPingFaildCounter = 0;
|
|
46260
|
-
self._establishConnection(params);
|
|
46261
|
-
});
|
|
46262
|
-
|
|
46249
|
+
self.isConnected = false;
|
|
46250
|
+
self._isConnecting = false;
|
|
46251
|
+
self._localPingFaildCounter = 0;
|
|
46252
|
+
self._establishConnection(params);
|
|
46263
46253
|
}
|
|
46264
46254
|
} else {
|
|
46265
46255
|
Utils.QBLog('[QBChat]',
|
|
@@ -46287,9 +46277,6 @@ ChatProxy.prototype = {
|
|
|
46287
46277
|
var timeNow = new Date();
|
|
46288
46278
|
if (typeof config.qbTokenExpirationDate !== 'undefined') {
|
|
46289
46279
|
var timeLag = Math.round((timeNow.getTime() - config.qbTokenExpirationDate.getTime()) / (1000 * 60));
|
|
46290
|
-
//artan 25-08-2022
|
|
46291
|
-
// TODO: need to delete in task [CROS-823]
|
|
46292
|
-
console.log('timeLag: ', timeLag);
|
|
46293
46280
|
if (timeLag >= 0) {
|
|
46294
46281
|
self._sessionHasExpired = true;
|
|
46295
46282
|
Utils.safeCallbackCall(self.onSessionExpiredListener, null);
|
|
@@ -46826,6 +46813,7 @@ ChatProxy.prototype = {
|
|
|
46826
46813
|
},
|
|
46827
46814
|
|
|
46828
46815
|
isOnline: function(no, yes) {
|
|
46816
|
+
//
|
|
46829
46817
|
const server = 'chat.quickblox.com';
|
|
46830
46818
|
try {
|
|
46831
46819
|
this.ping(server, (error) => {
|
|
@@ -46839,6 +46827,77 @@ ChatProxy.prototype = {
|
|
|
46839
46827
|
no();
|
|
46840
46828
|
}
|
|
46841
46829
|
},
|
|
46830
|
+
/*
|
|
46831
|
+
isOnlineAction0: function(no, yes) {
|
|
46832
|
+
const host = 'chat.quickblox.com';
|
|
46833
|
+
try {
|
|
46834
|
+
this.ping(host, function (error) {
|
|
46835
|
+
console.log('isOnlineAction0 call ping');
|
|
46836
|
+
if (error) {
|
|
46837
|
+
console.log('call isOnlineAction0, ping - Failed, ', error);
|
|
46838
|
+
no();
|
|
46839
|
+
} else {
|
|
46840
|
+
console.log('call isOnlineAction0, ping - OK');
|
|
46841
|
+
yes();
|
|
46842
|
+
}
|
|
46843
|
+
});
|
|
46844
|
+
} catch (err) {
|
|
46845
|
+
console.log('call isOnlineAction0, Exception isOnlineAction0 function, ', err);
|
|
46846
|
+
no();
|
|
46847
|
+
}
|
|
46848
|
+
},
|
|
46849
|
+
|
|
46850
|
+
isOnlineAction1: function(no, yes) {
|
|
46851
|
+
try {
|
|
46852
|
+
var jid = this.helpers.getUserCurrentJid();
|
|
46853
|
+
console.log('JID: ', jid);
|
|
46854
|
+
this.ping(
|
|
46855
|
+
jid,
|
|
46856
|
+
function (err) {
|
|
46857
|
+
console.log('isOnlineAction1 call ping');
|
|
46858
|
+
if (err) {
|
|
46859
|
+
console.log('isOnlineAction1 call ping');
|
|
46860
|
+
no();
|
|
46861
|
+
}
|
|
46862
|
+
else {
|
|
46863
|
+
console.log('call isOnlineAction1, ping - OK');
|
|
46864
|
+
yes();
|
|
46865
|
+
}
|
|
46866
|
+
}
|
|
46867
|
+
);
|
|
46868
|
+
} catch (e) {
|
|
46869
|
+
console.log('call isOnlineAction1, Exception isOnlineAction1 function, ', e);
|
|
46870
|
+
no();
|
|
46871
|
+
}
|
|
46872
|
+
},
|
|
46873
|
+
|
|
46874
|
+
isOnlineAction2: function(no, yes) {
|
|
46875
|
+
var params = {
|
|
46876
|
+
order: {
|
|
46877
|
+
field: 'created_at',
|
|
46878
|
+
sort: 'asc'
|
|
46879
|
+
},
|
|
46880
|
+
page: 1,
|
|
46881
|
+
per_page: 10
|
|
46882
|
+
};
|
|
46883
|
+
|
|
46884
|
+
try {
|
|
46885
|
+
qbMain.users.listUsers(params, function(error, result){
|
|
46886
|
+
if (error) {
|
|
46887
|
+
console.log('isOnlineAction2 call ping');
|
|
46888
|
+
no();
|
|
46889
|
+
}
|
|
46890
|
+
else {
|
|
46891
|
+
console.log('call isOnlineAction2, ping - OK');
|
|
46892
|
+
yes();
|
|
46893
|
+
}
|
|
46894
|
+
});
|
|
46895
|
+
} catch(e) {
|
|
46896
|
+
console.log('call isOnlineAction2, Exception isOnlineAction2 function, ', e);
|
|
46897
|
+
no();
|
|
46898
|
+
}
|
|
46899
|
+
},
|
|
46900
|
+
*/
|
|
46842
46901
|
|
|
46843
46902
|
ping: function (jid_or_user_id, callback) {
|
|
46844
46903
|
Utils.QBLog('[QBChat]', 'Call ping ');
|
|
@@ -53594,8 +53653,8 @@ module.exports = StreamManagement;
|
|
|
53594
53653
|
*/
|
|
53595
53654
|
|
|
53596
53655
|
var config = {
|
|
53597
|
-
version: '2.15.
|
|
53598
|
-
buildNumber: '
|
|
53656
|
+
version: '2.15.1',
|
|
53657
|
+
buildNumber: '1139',
|
|
53599
53658
|
creds: {
|
|
53600
53659
|
'appId': 0,
|
|
53601
53660
|
'authKey': '',
|
|
@@ -53704,7 +53763,6 @@ config.updateSessionExpirationDate = function (tokenExpirationDate, headerHasTok
|
|
|
53704
53763
|
newDate.setMinutes ( newDate.getMinutes() + config.liveSessionInterval );
|
|
53705
53764
|
}
|
|
53706
53765
|
config.qbTokenExpirationDate = newDate;
|
|
53707
|
-
console.log('updateSessionExpirationDate ... Set value: ', config.qbTokenExpirationDate);
|
|
53708
53766
|
};
|
|
53709
53767
|
|
|
53710
53768
|
|
|
@@ -54136,6 +54194,8 @@ ServiceProxy.prototype = {
|
|
|
54136
54194
|
typeof qbTokenExpirationDate === 'undefined');
|
|
54137
54195
|
qbTokenExpirationDate = (headerHasToken) ? qbTokenExpirationDate : new Date();
|
|
54138
54196
|
self.qbInst.config.updateSessionExpirationDate(qbTokenExpirationDate, headerHasToken);
|
|
54197
|
+
Utils.QBLog('[Request][ajax]','header has token:',headerHasToken );
|
|
54198
|
+
Utils.QBLog('[Request][ajax]','updateSessionExpirationDate ... Set value: ', self.qbInst.config.qbTokenExpirationDate );
|
|
54139
54199
|
}
|
|
54140
54200
|
|
|
54141
54201
|
if (qbDataType === 'text') {
|