Skip to content

Commit a2f6c8e

Browse files
author
Igor Khomenko
committed
Merge branch 'gh-pages' of github.com:QuickBlox/quickblox-javascript-sdk into gh-pages
2 parents ac319f5 + 4452f55 commit a2f6c8e

File tree

8 files changed

+55
-61
lines changed

8 files changed

+55
-61
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For correct work of JS SDK you must include the library in your html before `qu
2020

2121
```html
2222
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
23-
<script src="https://cdnjs.cloudflare.com/ajax/libs/quickblox/2.3.0/quickblox.min.js"></script>
23+
<script src="https://cdnjs.cloudflare.com/ajax/libs/quickblox/2.3.1/quickblox.min.js"></script>
2424
```
2525

2626
## Bower and RequireJS

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quickblox",
33
"description": "QuickBlox JavaScript SDK",
4-
"version": "2.3.0",
4+
"version": "2.3.1",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "quickblox.js",
77
"license": "Apache 2.0",

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
{
22
"name": "quickblox",
33
"description": "QuickBlox JavaScript SDK",
4-
"version": "2.3.0",
4+
"version": "2.3.1",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "src/qbMain.js",
7-
"license": [
8-
{
9-
"type": "Apache 2.0",
10-
"url": "https://github.com/QuickBlox/quickblox-javascript-sdk/blob/master/LICENSE"
11-
}
12-
],
7+
"license" : "(Apache-2.0)",
138
"keywords": [
149
"quickblox",
1510
"javascript",

quickblox.min.js

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spec/QB-ChatSpec.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ describe('Chat API', function() {
102102
}
103103

104104
QB.chat.onSystemMessageListener = onSystemMessageListenerCb;
105-
105+
106106
QB.chat.sendSystemMessage(QBUser1.id, {'extension': extension});
107107
}, MESSAGING_TIMEOUT);
108108

@@ -209,18 +209,18 @@ describe('Chat API', function() {
209209
});
210210

211211
describe('[Roster] Contact list: ', function() {
212-
it('can retrieve contact list', function(done) {
213-
QB.chat.roster.get(function(roster) {
214-
expect(roster).toBeDefined();
215-
expect(roster).toEqual(jasmine.any(Object));
216-
212+
/** !!Don't give back any response */
213+
it('can add user to contact list', function(done) {
214+
QB.chat.roster.add(QBUser2.id, function() {
217215
done();
218216
});
219217
}, IQ_TIMEOUT);
220218

221-
/** !!Don't give back any response */
222-
it('can add user to contact list', function(done) {
223-
QB.chat.roster.add(QBUser2.id, function() {
219+
it('can retrieve contact list', function(done) {
220+
QB.chat.roster.get(function(roster) {
221+
expect(roster).toBeDefined();
222+
expect(QBUser2.id in roster).toEqual(true);
223+
224224
done();
225225
});
226226
}, IQ_TIMEOUT);
@@ -268,7 +268,7 @@ describe('Chat API', function() {
268268

269269
QB.chat.privacylist.update(list, function(error) {
270270
expect(error).toBeDefined();
271-
271+
272272
done();
273273
});
274274
});
@@ -287,7 +287,7 @@ describe('Chat API', function() {
287287
it('can set active list', function(done) {
288288
QB.chat.privacylist.setAsActive('test', function(error) {
289289
expect(error).toBeNull();
290-
290+
291291
done();
292292
});
293293
});
@@ -339,7 +339,7 @@ describe('Chat API', function() {
339339
describe('REST API', function() {
340340
var dialogId;
341341
var messageId;
342-
342+
343343
it('can create a dialog (group)', function(done) {
344344
var params = {
345345
occupants_ids: [QBUser2.id],
@@ -372,7 +372,7 @@ describe('Chat API', function() {
372372
var filters = null;
373373
QB.chat.dialog.list(filters, function(err, res) {
374374
expect(err).toBeNull();
375-
375+
376376
expect(res).not.toBeNull();
377377
expect(res.items.length).toBeGreaterThan(0);
378378

@@ -423,7 +423,7 @@ describe('Chat API', function() {
423423

424424
QB.chat.message.list(filters, function(err, res) {
425425
expect(err).toBeNull();
426-
426+
427427
expect(res).not.toBeNull();
428428
expect(res.items.length).toBeGreaterThan(0);
429429

@@ -436,7 +436,7 @@ describe('Chat API', function() {
436436

437437
QB.chat.message.unreadCount(params, function(err, res) {
438438
expect(err).toBeNull();
439-
439+
440440
expect(res.total).toEqual(0);
441441
expect(res[dialogId]).toEqual(0);
442442

@@ -463,7 +463,7 @@ describe('Chat API', function() {
463463
it('can delete a message with id', function(done) {
464464
QB.chat.message.delete([messageId, 'notExistentId'], {force: 1}, function(err, res) {
465465
expect(err).toBeNull();
466-
466+
467467
done();
468468

469469
messageId = null;
@@ -493,4 +493,4 @@ describe('Chat API', function() {
493493
//
494494
// QB.chat.disconnect();
495495
// }, REST_REQUESTS_TIMEOUT);
496-
});
496+
});

spec/QB-PushnotificationsSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ describe('PushNotifications API', function() {
5050
done.fail("Create a subscription error: " + JSON.stringify(err));
5151
} else {
5252
expect(res).not.toBeNull();
53-
expect(res[0].subscription.device.platform.name).toBe("android");
53+
//expect(res[0].subscription.device.platform.name).toBe("android");
5454

5555
done();
5656
}
@@ -66,7 +66,7 @@ describe('PushNotifications API', function() {
6666
expect(result[0].subscription.device.udid).toBe('jasmineUnique');
6767

6868
subscriptionId = result[0].subscription.id;
69-
69+
7070
done();
7171
}
7272
});
@@ -160,7 +160,7 @@ describe('PushNotifications API', function() {
160160
}
161161
});
162162
}, REST_REQUESTS_TIMEOUT);
163-
163+
164164
it("can delete event", function(done){
165165
QB.pushnotifications.events.delete(eventId, function(err, response) {
166166
expect(err).toBeNull();

src/modules/qbChat.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ function ChatProxy(service, webrtcModule, conn) {
200200
return;
201201
}
202202
}
203-
203+
204204
/** JOIN to dialog */
205205
if(stanza.attrs.id) {
206206
if(status && status.attrs.code == "110"){
@@ -383,15 +383,15 @@ ChatProxy.prototype = {
383383
break;
384384
case Strophe.Status.AUTHFAIL:
385385
err = Utils.getError(401, 'Status.AUTHFAIL - The authentication attempt failed');
386-
386+
387387
if (typeof callback === 'function') {
388388
callback(err, null);
389389
}
390390

391391
if(self._isDisconnected && typeof self.onReconnectFailedListener === 'function'){
392392
Utils.safeCallbackCall(self.onReconnectFailedListener, err);
393393
}
394-
394+
395395
break;
396396
case Strophe.Status.CONNECTED:
397397
Utils.QBLog('[ChatProxy]', 'Status.CONNECTED at ' + chatUtils.getLocalTime());
@@ -413,7 +413,7 @@ ChatProxy.prototype = {
413413

414414
// enable carbons
415415
self._enableCarbons();
416-
416+
417417
// get the roster
418418
self.roster.get(function(contacts) {
419419
roster = contacts;
@@ -502,7 +502,7 @@ ChatProxy.prototype = {
502502

503503
nClient.on('reconnect', function () {
504504
Utils.QBLog('[QBChat] client is reconnected');
505-
505+
506506
self._isDisconnected = true;
507507
self._isLogout = true;
508508
});
@@ -519,9 +519,9 @@ ChatProxy.prototype = {
519519

520520
nClient.on('stanza', function (stanza) {
521521
Utils.QBLog('[QBChat] RECV', stanza.toString());
522-
522+
523523
/**
524-
* Detect typeof incoming stanza
524+
* Detect typeof incoming stanza
525525
* and fire the Listener
526526
*/
527527
if (stanza.is('presence')) {
@@ -835,11 +835,10 @@ RosterProxy.prototype = {
835835
var items = _getItems(stanza);
836836
/** TODO */
837837
for (var i = 0, len = items.length; i < len; i++) {
838-
var userId = chatUtils.getAttr(items[i], 'name'),
838+
var userId = self.helpers.getIdFromNode( chatUtils.getAttr(items[i], 'jid') ),
839839
ask = chatUtils.getAttr(items[i], 'ask'),
840840
subscription = chatUtils.getAttr(items[i], 'subscription');
841841

842-
843842
contacts[userId] = {
844843
subscription: subscription,
845844
ask: ask || null
@@ -968,7 +967,7 @@ RosterProxy.prototype = {
968967
};
969968

970969
var pres = chatUtils.createStanza(builder, presParams, 'presence');
971-
970+
972971
Utils.QBLog('[_sendSubscriptionPresence]', params);
973972

974973
if(Utils.getEnv().browser){
@@ -1091,7 +1090,7 @@ MucProxy.prototype = {
10911090
connection.sendIQ(iq, function(stanza) {
10921091
var items = stanza.getElementsByTagName('item'),
10931092
userId;
1094-
1093+
10951094
for (var i = 0, len = items.length; i < len; i++) {
10961095
userId = self.helpers.getUserIdFromRoomJid(items[i].getAttribute('jid'));
10971096
onlineUsers.push(userId);
@@ -1121,7 +1120,7 @@ PrivacyListProxy.prototype = {
11211120
create: function(list, callback) {
11221121
var self = this,
11231122
userId, userJid, userMuc,
1124-
userAction,
1123+
userAction,
11251124
mutualBlock,
11261125
listPrivacy = {},
11271126
listUserId = [];
@@ -1148,7 +1147,7 @@ PrivacyListProxy.prototype = {
11481147

11491148
var iq = chatUtils.createStanza(builder, iqParams, 'iq');
11501149

1151-
iq.c('query', {
1150+
iq.c('query', {
11521151
xmlns: chatUtils.MARKERS.PRIVACY
11531152
}).c('list', {
11541153
name: list.name
@@ -1783,4 +1782,4 @@ Helpers.prototype = {
17831782
}
17841783
};
17851784

1786-
module.exports = ChatProxy;
1785+
module.exports = ChatProxy;

src/qbConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111

1212
var config = {
13-
version: '2.3.0',
13+
version: '2.3.1',
1414
creds: {
1515
appId: '',
1616
authKey: '',

0 commit comments

Comments
 (0)