Skip to content

Commit ae3be95

Browse files
version 2.15.1 created.
1 parent 57fdd9f commit ae3be95

File tree

6 files changed

+162
-42
lines changed

6 files changed

+162
-42
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Check out our [API Reference](https://quickblox.github.io/quickblox-javascript-s
1616
## Dependencies for browser
1717

1818
```html
19-
<script src="https://unpkg.com/[email protected].0/quickblox.min.js"></script>
19+
<script src="https://unpkg.com/[email protected].1/quickblox.min.js"></script>
2020
```
2121

2222
## Bower and RequireJS

quickblox.js

Lines changed: 80 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46246,20 +46246,10 @@ ChatProxy.prototype = {
4624646246
' error: ', error);
4624746247
self._localPingFaildCounter += 1;
4624846248
if (self._localPingFaildCounter > 6) {
46249-
// TODO: check in [CROS-823]
46250-
self.isOnline(function () {
46251-
Utils.QBLog('[QBChat]',
46252-
'Local Ping: ',
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);
4626346253
}
4626446254
} else {
4626546255
Utils.QBLog('[QBChat]',
@@ -46287,9 +46277,6 @@ ChatProxy.prototype = {
4628746277
var timeNow = new Date();
4628846278
if (typeof config.qbTokenExpirationDate !== 'undefined') {
4628946279
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);
4629346280
if (timeLag >= 0) {
4629446281
self._sessionHasExpired = true;
4629546282
Utils.safeCallbackCall(self.onSessionExpiredListener, null);
@@ -46826,6 +46813,7 @@ ChatProxy.prototype = {
4682646813
},
4682746814

4682846815
isOnline: function(no, yes) {
46816+
//
4682946817
const server = 'chat.quickblox.com';
4683046818
try {
4683146819
this.ping(server, (error) => {
@@ -46839,6 +46827,77 @@ ChatProxy.prototype = {
4683946827
no();
4684046828
}
4684146829
},
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+
*/
4684246901

4684346902
ping: function (jid_or_user_id, callback) {
4684446903
Utils.QBLog('[QBChat]', 'Call ping ');
@@ -53594,8 +53653,8 @@ module.exports = StreamManagement;
5359453653
*/
5359553654

5359653655
var config = {
53597-
version: '2.15.0',
53598-
buildNumber: '1137',
53656+
version: '2.15.1',
53657+
buildNumber: '1139',
5359953658
creds: {
5360053659
'appId': 0,
5360153660
'authKey': '',
@@ -53704,7 +53763,6 @@ config.updateSessionExpirationDate = function (tokenExpirationDate, headerHasTok
5370453763
newDate.setMinutes ( newDate.getMinutes() + config.liveSessionInterval );
5370553764
}
5370653765
config.qbTokenExpirationDate = newDate;
53707-
console.log('updateSessionExpirationDate ... Set value: ', config.qbTokenExpirationDate);
5370853766
};
5370953767

5371053768

@@ -54136,6 +54194,8 @@ ServiceProxy.prototype = {
5413654194
typeof qbTokenExpirationDate === 'undefined');
5413754195
qbTokenExpirationDate = (headerHasToken) ? qbTokenExpirationDate : new Date();
5413854196
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 );
5413954199
}
5414054200

5414154201
if (qbDataType === 'text') {

quickblox.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modules/chat/qbChat.js

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -822,20 +822,10 @@ ChatProxy.prototype = {
822822
' error: ', error);
823823
self._localPingFaildCounter += 1;
824824
if (self._localPingFaildCounter > 6) {
825-
// TODO: check in [CROS-823]
826-
self.isOnline(function () {
827-
Utils.QBLog('[QBChat]',
828-
'Local Ping: ',
829-
'connection failed, at ', Utils.getCurrentTime());
830-
}, function () {
831-
console.log("call _establishConnection ....");
832-
833-
self.isConnected = false;
834-
self._isConnecting = false;
835-
self._localPingFaildCounter = 0;
836-
self._establishConnection(params);
837-
});
838-
825+
self.isConnected = false;
826+
self._isConnecting = false;
827+
self._localPingFaildCounter = 0;
828+
self._establishConnection(params);
839829
}
840830
} else {
841831
Utils.QBLog('[QBChat]',
@@ -863,9 +853,6 @@ ChatProxy.prototype = {
863853
var timeNow = new Date();
864854
if (typeof config.qbTokenExpirationDate !== 'undefined') {
865855
var timeLag = Math.round((timeNow.getTime() - config.qbTokenExpirationDate.getTime()) / (1000 * 60));
866-
//artan 25-08-2022
867-
// TODO: need to delete in task [CROS-823]
868-
console.log('timeLag: ', timeLag);
869856
if (timeLag >= 0) {
870857
self._sessionHasExpired = true;
871858
Utils.safeCallbackCall(self.onSessionExpiredListener, null);
@@ -1402,6 +1389,7 @@ ChatProxy.prototype = {
14021389
},
14031390

14041391
isOnline: function(no, yes) {
1392+
//
14051393
const server = 'chat.quickblox.com';
14061394
try {
14071395
this.ping(server, (error) => {
@@ -1415,6 +1403,77 @@ ChatProxy.prototype = {
14151403
no();
14161404
}
14171405
},
1406+
/*
1407+
isOnlineAction0: function(no, yes) {
1408+
const host = 'chat.quickblox.com';
1409+
try {
1410+
this.ping(host, function (error) {
1411+
console.log('isOnlineAction0 call ping');
1412+
if (error) {
1413+
console.log('call isOnlineAction0, ping - Failed, ', error);
1414+
no();
1415+
} else {
1416+
console.log('call isOnlineAction0, ping - OK');
1417+
yes();
1418+
}
1419+
});
1420+
} catch (err) {
1421+
console.log('call isOnlineAction0, Exception isOnlineAction0 function, ', err);
1422+
no();
1423+
}
1424+
},
1425+
1426+
isOnlineAction1: function(no, yes) {
1427+
try {
1428+
var jid = this.helpers.getUserCurrentJid();
1429+
console.log('JID: ', jid);
1430+
this.ping(
1431+
jid,
1432+
function (err) {
1433+
console.log('isOnlineAction1 call ping');
1434+
if (err) {
1435+
console.log('isOnlineAction1 call ping');
1436+
no();
1437+
}
1438+
else {
1439+
console.log('call isOnlineAction1, ping - OK');
1440+
yes();
1441+
}
1442+
}
1443+
);
1444+
} catch (e) {
1445+
console.log('call isOnlineAction1, Exception isOnlineAction1 function, ', e);
1446+
no();
1447+
}
1448+
},
1449+
1450+
isOnlineAction2: function(no, yes) {
1451+
var params = {
1452+
order: {
1453+
field: 'created_at',
1454+
sort: 'asc'
1455+
},
1456+
page: 1,
1457+
per_page: 10
1458+
};
1459+
1460+
try {
1461+
qbMain.users.listUsers(params, function(error, result){
1462+
if (error) {
1463+
console.log('isOnlineAction2 call ping');
1464+
no();
1465+
}
1466+
else {
1467+
console.log('call isOnlineAction2, ping - OK');
1468+
yes();
1469+
}
1470+
});
1471+
} catch(e) {
1472+
console.log('call isOnlineAction2, Exception isOnlineAction2 function, ', e);
1473+
no();
1474+
}
1475+
},
1476+
*/
14181477

14191478
ping: function (jid_or_user_id, callback) {
14201479
Utils.QBLog('[QBChat]', 'Call ping ');

src/qbConfig.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
*/
1313

1414
var config = {
15-
version: '2.15.0',
16-
buildNumber: '1137',
15+
version: '2.15.1',
16+
buildNumber: '1139',
1717
creds: {
1818
'appId': 0,
1919
'authKey': '',
@@ -122,7 +122,6 @@ config.updateSessionExpirationDate = function (tokenExpirationDate, headerHasTok
122122
newDate.setMinutes ( newDate.getMinutes() + config.liveSessionInterval );
123123
}
124124
config.qbTokenExpirationDate = newDate;
125-
console.log('updateSessionExpirationDate ... Set value: ', config.qbTokenExpirationDate);
126125
};
127126

128127

src/qbProxy.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ ServiceProxy.prototype = {
146146
typeof qbTokenExpirationDate === 'undefined');
147147
qbTokenExpirationDate = (headerHasToken) ? qbTokenExpirationDate : new Date();
148148
self.qbInst.config.updateSessionExpirationDate(qbTokenExpirationDate, headerHasToken);
149+
Utils.QBLog('[Request][ajax]','header has token:',headerHasToken );
150+
Utils.QBLog('[Request][ajax]','updateSessionExpirationDate ... Set value: ', self.qbInst.config.qbTokenExpirationDate );
149151
}
150152

151153
if (qbDataType === 'text') {

0 commit comments

Comments
 (0)