quickblox 2.15.1 → 2.15.2
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 +3 -3
- package/quickblox.js +18881 -18974
- package/quickblox.min.js +1 -1
- package/src/modules/chat/qbChat.js +98 -185
- package/src/modules/chat/qbDialog.js +12 -12
- package/src/modules/chat/qbMessage.js +18 -18
- package/src/modules/qbAddressBook.js +4 -4
- package/src/modules/qbContent.js +71 -71
- package/src/modules/qbData.js +65 -66
- package/src/modules/qbPushNotifications.js +77 -73
- package/src/modules/qbUsers.js +77 -77
- package/src/modules/webrtc/qbRTCPeerConnection.js +30 -4
- package/src/modules/webrtc/qbWebRTCClient.js +28 -15
- package/src/modules/webrtc/qbWebRTCSession.js +80 -50
- package/src/plugins/streamManagement.js +11 -8
- package/src/qbConfig.js +3 -2
- package/src/qbMain.js +17 -16
- package/src/qbUtils.js +5 -1
|
@@ -158,61 +158,61 @@ function ChatProxy(service) {
|
|
|
158
158
|
*/
|
|
159
159
|
|
|
160
160
|
/**
|
|
161
|
-
* You need to set onMessageListener function, to get messages
|
|
161
|
+
* You need to set onMessageListener function, to get messages({@link https://docs.quickblox.com/docs/js-chat-messaging#subscribe-message-events read more}).
|
|
162
162
|
* @function onMessageListener
|
|
163
163
|
* @memberOf QB.chat
|
|
164
|
-
* @param {Number} userId - Sender id
|
|
165
|
-
* @param {Object} message - The message model object
|
|
164
|
+
* @param {Number} userId - Sender id.
|
|
165
|
+
* @param {Object} message - The message model object.
|
|
166
166
|
**/
|
|
167
167
|
|
|
168
168
|
/**
|
|
169
|
-
* Blocked entities receive an error when try to chat with a user in a 1-1 chat and receivie nothing in a group chat.
|
|
169
|
+
* Blocked entities receive an error when try to chat with a user in a 1-1 chat and receivie nothing in a group chat.
|
|
170
170
|
* @function onMessageErrorListener
|
|
171
171
|
* @memberOf QB.chat
|
|
172
|
-
* @param {Number} messageId - The message id
|
|
173
|
-
* @param {Object} error - The error object
|
|
172
|
+
* @param {Number} messageId - The message id.
|
|
173
|
+
* @param {Object} error - The error object.
|
|
174
174
|
**/
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
* This feature defines an approach for ensuring is the message delivered to the server. This feature is unabled by default
|
|
177
|
+
* This feature defines an approach for ensuring is the message delivered to the server. This feature is unabled by default({@link https://docs.quickblox.com/docs/js-chat-messaging#check-if-a-message-is-sent read more}).
|
|
178
178
|
* @function onSentMessageCallback
|
|
179
179
|
* @memberOf QB.chat
|
|
180
|
-
* @param {Object} messageLost - The lost message model object (Fail)
|
|
181
|
-
* @param {Object} messageSent - The sent message model object (Success)
|
|
180
|
+
* @param {Object} messageLost - The lost message model object (Fail).
|
|
181
|
+
* @param {Object} messageSent - The sent message model object (Success).
|
|
182
182
|
**/
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
|
-
* Show typing status in chat or groupchat
|
|
185
|
+
* Show typing status in chat or groupchat({@link https://docs.quickblox.com/docs/js-chat-messaging#send-typing-indicators read more}).
|
|
186
186
|
* @function onMessageTypingListener
|
|
187
187
|
* @memberOf QB.chat
|
|
188
|
-
* @param {Boolean} isTyping - Typing Status (true - typing, false - stop typing)
|
|
189
|
-
* @param {Number} userId - Typing user id
|
|
190
|
-
* @param {String} dialogId - The dialog id
|
|
188
|
+
* @param {Boolean} isTyping - Typing Status (true - typing, false - stop typing).
|
|
189
|
+
* @param {Number} userId - Typing user id.
|
|
190
|
+
* @param {String} dialogId - The dialog id.
|
|
191
191
|
**/
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
* Receive delivery confirmations
|
|
194
|
+
* Receive delivery confirmations({@link https://docs.quickblox.com/docs/js-chat-messaging#mark-message-as-delivered read more}).
|
|
195
195
|
* @function onDeliveredStatusListener
|
|
196
196
|
* @memberOf QB.chat
|
|
197
|
-
* @param {String} messageId - Delivered message id
|
|
198
|
-
* @param {String} dialogId - The dialog id
|
|
199
|
-
* @param {Number} userId - User id
|
|
197
|
+
* @param {String} messageId - Delivered message id.
|
|
198
|
+
* @param {String} dialogId - The dialog id.
|
|
199
|
+
* @param {Number} userId - User id.
|
|
200
200
|
**/
|
|
201
201
|
|
|
202
202
|
/**
|
|
203
|
-
* You can manage 'read' notifications in chat
|
|
203
|
+
* You can manage 'read' notifications in chat({@link https://docs.quickblox.com/docs/js-chat-messaging#mark-message-as-read read more}).
|
|
204
204
|
* @function onReadStatusListener
|
|
205
205
|
* @memberOf QB.chat
|
|
206
|
-
* @param {String} messageId - Read message id
|
|
207
|
-
* @param {String} dialogId - The dialog id
|
|
208
|
-
* @param {Number} userId - User Id
|
|
206
|
+
* @param {String} messageId - Read message id.
|
|
207
|
+
* @param {String} dialogId - The dialog id.
|
|
208
|
+
* @param {Number} userId - User Id.
|
|
209
209
|
**/
|
|
210
210
|
|
|
211
211
|
/**
|
|
212
|
-
* These messages work over separated channel and won't be mixed with the regular chat messages
|
|
212
|
+
* These messages work over separated channel and won't be mixed with the regular chat messages({@link https://docs.quickblox.com/docs/js-chat-messaging#send-system-messages read more}).
|
|
213
213
|
* @function onSystemMessageListener
|
|
214
214
|
* @memberOf QB.chat
|
|
215
|
-
* @param {Object} message - The system message model object. Always have type: 'headline'
|
|
215
|
+
* @param {Object} message - The system message model object. Always have type: 'headline'.
|
|
216
216
|
**/
|
|
217
217
|
|
|
218
218
|
/**
|
|
@@ -240,50 +240,50 @@ function ChatProxy(service) {
|
|
|
240
240
|
**/
|
|
241
241
|
|
|
242
242
|
/**
|
|
243
|
-
* Receive user status (online / offline)
|
|
243
|
+
* Receive user status (online / offline)({@link https://docs.quickblox.com/docs/js-chat-contact-list#contact-list-updates read more}).
|
|
244
244
|
* @function onContactListListener
|
|
245
245
|
* @memberOf QB.chat
|
|
246
|
-
* @param {Number} userId - The sender ID
|
|
247
|
-
* @param {String} type - If user leave the chat, type will be 'unavailable'
|
|
246
|
+
* @param {Number} userId - The sender ID.
|
|
247
|
+
* @param {String} type - If user leave the chat, type will be 'unavailable'.
|
|
248
248
|
**/
|
|
249
249
|
|
|
250
250
|
/**
|
|
251
|
-
* Receive subscription request
|
|
251
|
+
* Receive subscription request({@link https://docs.quickblox.com/docs/js-chat-contact-list#add-user-to-your-contact-list read more}).
|
|
252
252
|
* @function onSubscribeListener
|
|
253
253
|
* @memberOf QB.chat
|
|
254
|
-
* @param {Number} userId - The sender ID
|
|
254
|
+
* @param {Number} userId - The sender ID.
|
|
255
255
|
**/
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
|
-
* Receive confirm request
|
|
258
|
+
* Receive confirm request({@link https://docs.quickblox.com/docs/js-chat-contact-list#confirm-the-contact-request read more}).
|
|
259
259
|
* @function onConfirmSubscribeListener
|
|
260
260
|
* @memberOf QB.chat
|
|
261
261
|
* @param {Number} userId - The sender ID
|
|
262
262
|
**/
|
|
263
263
|
|
|
264
264
|
/**
|
|
265
|
-
* Receive reject request
|
|
265
|
+
* Receive reject request({@link https://docs.quickblox.com/docs/js-chat-contact-list#reject-the-contact-request read more}).
|
|
266
266
|
* @function onRejectSubscribeListener
|
|
267
267
|
* @memberOf QB.chat
|
|
268
268
|
* @param {Number} userId - The sender ID
|
|
269
269
|
**/
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
* Receive user's last activity (time ago).
|
|
272
|
+
* Receive user's last activity (time ago).
|
|
273
273
|
* @function onLastUserActivityListener
|
|
274
274
|
* @memberOf QB.chat
|
|
275
|
-
* @param {Number} userId - The user's ID which last activity time we receive
|
|
276
|
-
* @param {Number} seconds - Time ago (last activity in seconds or 0 if user online or undefined if user never registered in chat)
|
|
275
|
+
* @param {Number} userId - The user's ID which last activity time we receive.
|
|
276
|
+
* @param {Number} seconds - Time ago (last activity in seconds or 0 if user online or undefined if user never registered in chat).
|
|
277
277
|
*/
|
|
278
278
|
|
|
279
279
|
/**
|
|
280
|
-
* Run after disconnect from chat
|
|
280
|
+
* Run after disconnect from chat({@linkhttps://docs.quickblox.com/docs/js-chat-connection#disconnect-from-chat-server read more}).
|
|
281
281
|
* @function onDisconnectedListener
|
|
282
282
|
* @memberOf QB.chat
|
|
283
283
|
**/
|
|
284
284
|
|
|
285
285
|
/**
|
|
286
|
-
* By default Javascript SDK reconnects automatically when connection to server is lost
|
|
286
|
+
* By default Javascript SDK reconnects automatically when connection to server is lost({@link https://docs.quickblox.com/docs/js-chat-connection#reconnection read more}).
|
|
287
287
|
* @function onReconnectListener
|
|
288
288
|
* @memberOf QB.chat
|
|
289
289
|
**/
|
|
@@ -695,20 +695,20 @@ function ChatProxy(service) {
|
|
|
695
695
|
ChatProxy.prototype = {
|
|
696
696
|
|
|
697
697
|
/**
|
|
698
|
-
* self.connection to the chat
|
|
698
|
+
* self.connection to the chat({@link https://docs.quickblox.com/docs/js-chat-connection#connect-to-chat-server read more})
|
|
699
699
|
* @memberof QB.chat
|
|
700
|
-
* @param {Object} params - Connect to the chat parameters
|
|
701
|
-
* @param {Number} params.userId - Connect to the chat by user id (use instead params.email and params.jid)
|
|
702
|
-
* @param {String} params.jid - Connect to the chat by user jid (use instead params.userId and params.email)
|
|
703
|
-
* @param {String} params.email - Connect to the chat by user's email (use instead params.userId and params.jid)
|
|
704
|
-
* @param {String} params.password - The user's password or session token
|
|
705
|
-
* @param {chatConnectCallback} callback - The chatConnectCallback callback
|
|
700
|
+
* @param {Object} params - Connect to the chat parameters.
|
|
701
|
+
* @param {Number} params.userId - Connect to the chat by user id (use instead params.email and params.jid).
|
|
702
|
+
* @param {String} params.jid - Connect to the chat by user jid (use instead params.userId and params.email).
|
|
703
|
+
* @param {String} params.email - Connect to the chat by user's email (use instead params.userId and params.jid).
|
|
704
|
+
* @param {String} params.password - The user's password or session token.
|
|
705
|
+
* @param {chatConnectCallback} callback - The chatConnectCallback callback.
|
|
706
706
|
* */
|
|
707
707
|
connect: function(params, callback) {
|
|
708
708
|
/**
|
|
709
709
|
* This callback Returns error or contact list.
|
|
710
710
|
* @callback chatConnectCallback
|
|
711
|
-
* @param {Object} error - The error object
|
|
711
|
+
* @param {Object} error - The error object.
|
|
712
712
|
* @param {(Object|Boolean)} response - Object of subscribed users (roster) or empty body.
|
|
713
713
|
* */
|
|
714
714
|
Utils.QBLog('[QBChat]', 'Connect with parameters ' + JSON.stringify(params));
|
|
@@ -1073,11 +1073,11 @@ ChatProxy.prototype = {
|
|
|
1073
1073
|
},
|
|
1074
1074
|
|
|
1075
1075
|
/**
|
|
1076
|
-
* Send message to 1 to 1 or group dialog
|
|
1076
|
+
* Send message to 1 to 1 or group dialog({@link https://docs.quickblox.com/docs/js-chat-messaging#send-text-message read more}).
|
|
1077
1077
|
* @memberof QB.chat
|
|
1078
|
-
* @param {String | Number} jid_or_user_id - Use opponent id
|
|
1078
|
+
* @param {String | Number} jid_or_user_id - Use opponent id for 1 to 1 chat, and room jid for group chat.
|
|
1079
1079
|
* @param {Object} message - The message object.
|
|
1080
|
-
* @returns {String} messageId - The current message id (was generated by SDK)
|
|
1080
|
+
* @returns {String} messageId - The current message id (was generated by SDK).
|
|
1081
1081
|
* */
|
|
1082
1082
|
send: function(jid_or_user_id, message) {
|
|
1083
1083
|
Utils.QBLog('[QBChat]', 'Call send ' + JSON.stringify(message));
|
|
@@ -1136,11 +1136,11 @@ ChatProxy.prototype = {
|
|
|
1136
1136
|
},
|
|
1137
1137
|
|
|
1138
1138
|
/**
|
|
1139
|
-
* Send system message (system notification) to 1 to 1 or group dialog
|
|
1139
|
+
* Send system message (system notification) to 1 to 1 or group dialog({@link https://docs.quickblox.com/docs/js-chat-messaging#send-system-messages read more}).
|
|
1140
1140
|
* @memberof QB.chat
|
|
1141
|
-
* @param {String | Number} jid_or_user_id - Use opponent id
|
|
1141
|
+
* @param {String | Number} jid_or_user_id - Use opponent id for 1 to 1 chat, and room jid for group chat.
|
|
1142
1142
|
* @param {Object} message - The message object.
|
|
1143
|
-
* @returns {String} messageId - The current message id (was generated by SDK)
|
|
1143
|
+
* @returns {String} messageId - The current message id (was generated by SDK).
|
|
1144
1144
|
* */
|
|
1145
1145
|
sendSystemMessage: function(jid_or_user_id, message) {
|
|
1146
1146
|
Utils.QBLog('[QBChat]', 'Call sendSystemMessage ' + JSON.stringify(message));
|
|
@@ -1187,9 +1187,9 @@ ChatProxy.prototype = {
|
|
|
1187
1187
|
},
|
|
1188
1188
|
|
|
1189
1189
|
/**
|
|
1190
|
-
* Send is typing status
|
|
1190
|
+
* Send is typing status({@link https://docs.quickblox.com/docs/js-chat-messaging#send-typing-indicators read more}).
|
|
1191
1191
|
* @memberof QB.chat
|
|
1192
|
-
* @param {String | Number} jid_or_user_id - Use opponent id
|
|
1192
|
+
* @param {String | Number} jid_or_user_id - Use opponent id for 1 to 1 chat, and room jid for group chat.
|
|
1193
1193
|
* */
|
|
1194
1194
|
sendIsTypingStatus: function(jid_or_user_id) {
|
|
1195
1195
|
Utils.QBLog('[QBChat]', 'Call sendIsTypingStatus ');
|
|
@@ -1215,9 +1215,9 @@ ChatProxy.prototype = {
|
|
|
1215
1215
|
},
|
|
1216
1216
|
|
|
1217
1217
|
/**
|
|
1218
|
-
* Send is stop typing status
|
|
1218
|
+
* Send is stop typing status({@link https://docs.quickblox.com/docs/js-chat-messaging#send-typing-indicators read more}).
|
|
1219
1219
|
* @memberof QB.chat
|
|
1220
|
-
* @param {String | Number} jid_or_user_id - Use opponent id
|
|
1220
|
+
* @param {String | Number} jid_or_user_id - Use opponent id for 1 to 1 chat, and room jid for group chat.
|
|
1221
1221
|
* */
|
|
1222
1222
|
sendIsStopTypingStatus: function(jid_or_user_id) {
|
|
1223
1223
|
Utils.QBLog('[QBChat]', 'Call sendIsStopTypingStatus ');
|
|
@@ -1243,12 +1243,12 @@ ChatProxy.prototype = {
|
|
|
1243
1243
|
},
|
|
1244
1244
|
|
|
1245
1245
|
/**
|
|
1246
|
-
* Send is delivered status
|
|
1246
|
+
* Send is delivered status({@link https://docs.quickblox.com/docs/js-chat-messaging#mark-message-as-delivered read more}).
|
|
1247
1247
|
* @memberof QB.chats
|
|
1248
|
-
* @param {Object} params - Object of parameters
|
|
1249
|
-
* @param {Number} params.userId - The receiver id
|
|
1250
|
-
* @param {Number} params.messageId - The delivered message id
|
|
1251
|
-
* @param {Number} params.dialogId - The dialog id
|
|
1248
|
+
* @param {Object} params - Object of parameters.
|
|
1249
|
+
* @param {Number} params.userId - The receiver id.
|
|
1250
|
+
* @param {Number} params.messageId - The delivered message id.
|
|
1251
|
+
* @param {Number} params.dialogId - The dialog id.
|
|
1252
1252
|
* */
|
|
1253
1253
|
sendDeliveredStatus: function(params) {
|
|
1254
1254
|
Utils.QBLog('[QBChat]', 'Call sendDeliveredStatus ');
|
|
@@ -1280,12 +1280,12 @@ ChatProxy.prototype = {
|
|
|
1280
1280
|
},
|
|
1281
1281
|
|
|
1282
1282
|
/**
|
|
1283
|
-
* Send is read status
|
|
1283
|
+
* Send is read status({@link https://docs.quickblox.com/docs/js-chat-messaging#mark-message-as-read read more}).
|
|
1284
1284
|
* @memberof QB.chat
|
|
1285
|
-
* @param {Object} params - Object of parameters
|
|
1286
|
-
* @param {Number} params.userId - The receiver id
|
|
1287
|
-
* @param {Number} params.messageId - The delivered message id
|
|
1288
|
-
* @param {Number} params.dialogId - The dialog id
|
|
1285
|
+
* @param {Object} params - Object of parameters.
|
|
1286
|
+
* @param {Number} params.userId - The receiver id.
|
|
1287
|
+
* @param {Number} params.messageId - The delivered message id.
|
|
1288
|
+
* @param {Number} params.dialogId - The dialog id.
|
|
1289
1289
|
* */
|
|
1290
1290
|
sendReadStatus: function(params) {
|
|
1291
1291
|
Utils.QBLog('[QBChat]', 'Call sendReadStatus ' + JSON.stringify(params));
|
|
@@ -1317,9 +1317,9 @@ ChatProxy.prototype = {
|
|
|
1317
1317
|
},
|
|
1318
1318
|
|
|
1319
1319
|
/**
|
|
1320
|
-
* Send query to get last user activity by QB.chat.onLastUserActivityListener(userId, seconds)
|
|
1320
|
+
* Send query to get last user activity by QB.chat.onLastUserActivityListener(userId, seconds)({@link https://xmpp.org/extensions/xep-0012.html read more}).
|
|
1321
1321
|
* @memberof QB.chat
|
|
1322
|
-
* @param {(Number|String)} jid_or_user_id - The user id or jid, that the last activity we want to know
|
|
1322
|
+
* @param {(Number|String)} jid_or_user_id - The user id or jid, that the last activity we want to know.
|
|
1323
1323
|
* */
|
|
1324
1324
|
getLastUserActivity: function(jid_or_user_id) {
|
|
1325
1325
|
Utils.QBLog('[QBChat]', 'Call getLastUserActivity ');
|
|
@@ -1388,93 +1388,6 @@ ChatProxy.prototype = {
|
|
|
1388
1388
|
return id;
|
|
1389
1389
|
},
|
|
1390
1390
|
|
|
1391
|
-
isOnline: function(no, yes) {
|
|
1392
|
-
//
|
|
1393
|
-
const server = 'chat.quickblox.com';
|
|
1394
|
-
try {
|
|
1395
|
-
this.ping(server, (error) => {
|
|
1396
|
-
if (error) {
|
|
1397
|
-
no();
|
|
1398
|
-
} else {
|
|
1399
|
-
yes();
|
|
1400
|
-
}
|
|
1401
|
-
});
|
|
1402
|
-
} catch (err) {
|
|
1403
|
-
no();
|
|
1404
|
-
}
|
|
1405
|
-
},
|
|
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
|
-
*/
|
|
1477
|
-
|
|
1478
1391
|
ping: function (jid_or_user_id, callback) {
|
|
1479
1392
|
Utils.QBLog('[QBChat]', 'Call ping ');
|
|
1480
1393
|
var self = this;
|
|
@@ -1524,7 +1437,7 @@ ChatProxy.prototype = {
|
|
|
1524
1437
|
},
|
|
1525
1438
|
|
|
1526
1439
|
/**
|
|
1527
|
-
*
|
|
1440
|
+
* Disconnect from the Chat({@link https://docs.quickblox.com/docs/js-chat-connection#disconnect-from-chat-server read more}).
|
|
1528
1441
|
* @memberof QB.chat
|
|
1529
1442
|
* */
|
|
1530
1443
|
disconnect: function() {
|
|
@@ -1625,7 +1538,7 @@ function RosterProxy(options) {
|
|
|
1625
1538
|
RosterProxy.prototype = {
|
|
1626
1539
|
|
|
1627
1540
|
/**
|
|
1628
|
-
* Receive contact list
|
|
1541
|
+
* Receive contact list({@link https://docs.quickblox.com/docs/js-chat-contact-list#access-contact-list read more}).
|
|
1629
1542
|
* @memberof QB.chat.roster
|
|
1630
1543
|
* @param {getRosterCallback} callback - The callback function.
|
|
1631
1544
|
* */
|
|
@@ -1684,7 +1597,7 @@ RosterProxy.prototype = {
|
|
|
1684
1597
|
},
|
|
1685
1598
|
|
|
1686
1599
|
/**
|
|
1687
|
-
* Add users to contact list
|
|
1600
|
+
* Add users to contact list({@link https://docs.quickblox.com/docs/js-chat-contact-list#add-user-to-your-contact-list read more}).
|
|
1688
1601
|
* @memberof QB.chat.roster
|
|
1689
1602
|
* @param {String | Number} jidOrUserId - Use opponent id for 1 to 1 chat, and jid for group chat.
|
|
1690
1603
|
* @param {addRosterCallback} callback - The callback function.
|
|
@@ -1715,7 +1628,7 @@ RosterProxy.prototype = {
|
|
|
1715
1628
|
},
|
|
1716
1629
|
|
|
1717
1630
|
/**
|
|
1718
|
-
* Confirm subscription with some user
|
|
1631
|
+
* Confirm subscription with some user({@link https://docs.quickblox.com/docs/js-chat-contact-list#confirm-the-contact-request read more}).
|
|
1719
1632
|
* @memberof QB.chat.roster
|
|
1720
1633
|
* @param {String | Number} jidOrUserId - Use opponent id for 1 to 1 chat, and jid for group chat.
|
|
1721
1634
|
* @param {confirmRosterCallback} callback - The callback function.
|
|
@@ -1752,7 +1665,7 @@ RosterProxy.prototype = {
|
|
|
1752
1665
|
},
|
|
1753
1666
|
|
|
1754
1667
|
/**
|
|
1755
|
-
* Reject subscription with some user
|
|
1668
|
+
* Reject subscription with some user({@link https://docs.quickblox.com/docs/js-chat-contact-list#reject-the-contact-request read more}).
|
|
1756
1669
|
* @memberof QB.chat.roster
|
|
1757
1670
|
* @param {String | Number} jidOrUserId - Use opponent id for 1 to 1 chat, and jid for group chat.
|
|
1758
1671
|
* @param {rejectRosterCallback} callback - The callback function.
|
|
@@ -1784,7 +1697,7 @@ RosterProxy.prototype = {
|
|
|
1784
1697
|
|
|
1785
1698
|
|
|
1786
1699
|
/**
|
|
1787
|
-
* Remove subscription with some user from your contact list
|
|
1700
|
+
* Remove subscription with some user from your contact list({@link https://docs.quickblox.com/docs/js-chat-contact-list#remove-user-from-the-contact-list read more}).
|
|
1788
1701
|
* @memberof QB.chat.roster
|
|
1789
1702
|
* @param {String | Number} jidOrUserId - Use opponent id for 1 to 1 chat, and jid for group chat.
|
|
1790
1703
|
* @param {removeRosterCallback} callback - The callback function.
|
|
@@ -1871,7 +1784,7 @@ function MucProxy(options) {
|
|
|
1871
1784
|
MucProxy.prototype = {
|
|
1872
1785
|
|
|
1873
1786
|
/**
|
|
1874
|
-
* Join to the group dialog
|
|
1787
|
+
* Join to the group dialog({@link https://docs.quickblox.com/docs/js-chat-dialogs#join-dialog read more}).
|
|
1875
1788
|
* @memberof QB.chat.muc
|
|
1876
1789
|
* @param {String} dialogIdOrJid - Use dialog jid or dialog id to join to this dialog.
|
|
1877
1790
|
* @param {joinMacCallback} callback - The callback function.
|
|
@@ -1879,8 +1792,8 @@ MucProxy.prototype = {
|
|
|
1879
1792
|
join: function(dialogIdOrJid, callback) {
|
|
1880
1793
|
/**
|
|
1881
1794
|
* Callback for QB.chat.muc.join().
|
|
1882
|
-
* @param {Object} error - Returns error object or null
|
|
1883
|
-
* @param {Object} responce - Returns responce
|
|
1795
|
+
* @param {Object} error - Returns error object or null.
|
|
1796
|
+
* @param {Object} responce - Returns responce.
|
|
1884
1797
|
* @callback joinMacCallback
|
|
1885
1798
|
* */
|
|
1886
1799
|
var self = this,
|
|
@@ -1956,9 +1869,9 @@ MucProxy.prototype = {
|
|
|
1956
1869
|
},
|
|
1957
1870
|
|
|
1958
1871
|
/**
|
|
1959
|
-
* Leave group chat dialog
|
|
1872
|
+
* Leave group chat dialog({@link https://docs.quickblox.com/docs/js-chat-dialogs#leave-dialog read more}).
|
|
1960
1873
|
* @memberof QB.chat.muc
|
|
1961
|
-
* @param {String} dialogJid - Use dialog jid to
|
|
1874
|
+
* @param {String} dialogJid - Use dialog jid to leave to this dialog.
|
|
1962
1875
|
* @param {leaveMacCallback} callback - The callback function.
|
|
1963
1876
|
* */
|
|
1964
1877
|
leave: function(jid, callback) {
|
|
@@ -1999,15 +1912,15 @@ MucProxy.prototype = {
|
|
|
1999
1912
|
},
|
|
2000
1913
|
|
|
2001
1914
|
/**
|
|
2002
|
-
* Leave group chat dialog
|
|
1915
|
+
* Leave group chat dialog({@link https://docs.quickblox.com/docs/js-chat-dialogs#retrieve-online-users read more}).
|
|
2003
1916
|
* @memberof QB.chat.muc
|
|
2004
|
-
* @param {String} dialogJid - Use dialog jid to
|
|
1917
|
+
* @param {String} dialogJid - Use dialog jid to get a list of online usersr in this dialog.
|
|
2005
1918
|
* @param {listOnlineUsersMacCallback} callback - The callback function.
|
|
2006
1919
|
* */
|
|
2007
1920
|
listOnlineUsers: function(dialogJID, callback) {
|
|
2008
1921
|
/**
|
|
2009
1922
|
* Callback for QB.chat.muc.leave().
|
|
2010
|
-
* @param {Object} Users -
|
|
1923
|
+
* @param {Object} Users - List of online users.
|
|
2011
1924
|
* @callback listOnlineUsersMacCallback
|
|
2012
1925
|
* */
|
|
2013
1926
|
|
|
@@ -2082,15 +1995,15 @@ function PrivacyListProxy(options) {
|
|
|
2082
1995
|
**/
|
|
2083
1996
|
PrivacyListProxy.prototype = {
|
|
2084
1997
|
/**
|
|
2085
|
-
* Create a privacy list
|
|
1998
|
+
* Create a privacy list({@link https://docs.quickblox.com/docs/js-chat-privacy-list#create-privacy-list read more}).
|
|
2086
1999
|
* @memberof QB.chat.privacylist
|
|
2087
|
-
* @param {Object} list -
|
|
2000
|
+
* @param {Object} list - Privacy list object.
|
|
2088
2001
|
* @param {createPrivacylistCallback} callback - The callback function.
|
|
2089
2002
|
* */
|
|
2090
2003
|
create: function(list, callback) {
|
|
2091
2004
|
/**
|
|
2092
2005
|
* Callback for QB.chat.privacylist.create().
|
|
2093
|
-
* @param {Object} error - The error object
|
|
2006
|
+
* @param {Object} error - The error object.
|
|
2094
2007
|
* @callback createPrivacylistCallback
|
|
2095
2008
|
* */
|
|
2096
2009
|
var self = this,
|
|
@@ -2238,7 +2151,7 @@ PrivacyListProxy.prototype = {
|
|
|
2238
2151
|
},
|
|
2239
2152
|
|
|
2240
2153
|
/**
|
|
2241
|
-
* Get the privacy list
|
|
2154
|
+
* Get the privacy list({@link https://docs.quickblox.com/docs/js-chat-privacy-list#retrieve-privacy-list-by-name read more}).
|
|
2242
2155
|
* @memberof QB.chat.privacylist
|
|
2243
2156
|
* @param {String} name - The name of the list.
|
|
2244
2157
|
* @param {getListPrivacylistCallback} callback - The callback function.
|
|
@@ -2246,8 +2159,8 @@ PrivacyListProxy.prototype = {
|
|
|
2246
2159
|
getList: function(name, callback) {
|
|
2247
2160
|
/**
|
|
2248
2161
|
* Callback for QB.chat.privacylist.getList().
|
|
2249
|
-
* @param {Object} error - The error object
|
|
2250
|
-
* @param {Object} response - The privacy list object
|
|
2162
|
+
* @param {Object} error - The error object.
|
|
2163
|
+
* @param {Object} response - The privacy list object.
|
|
2251
2164
|
* @callback getListPrivacylistCallback
|
|
2252
2165
|
* */
|
|
2253
2166
|
|
|
@@ -2325,7 +2238,7 @@ PrivacyListProxy.prototype = {
|
|
|
2325
2238
|
},
|
|
2326
2239
|
|
|
2327
2240
|
/**
|
|
2328
|
-
* Update the privacy list.
|
|
2241
|
+
* Update the privacy list({@link https://docs.quickblox.com/docs/js-chat-privacy-list#update-privacy-list read more}).
|
|
2329
2242
|
* @memberof QB.chat.privacylist
|
|
2330
2243
|
* @param {String} name - The name of the list.
|
|
2331
2244
|
* @param {updatePrivacylistCallback} callback - The callback function.
|
|
@@ -2333,8 +2246,8 @@ PrivacyListProxy.prototype = {
|
|
|
2333
2246
|
update: function(listWithUpdates, callback) {
|
|
2334
2247
|
/**
|
|
2335
2248
|
* Callback for QB.chat.privacylist.update().
|
|
2336
|
-
* @param {Object} error - The error object
|
|
2337
|
-
* @param {Object} response - The privacy list object
|
|
2249
|
+
* @param {Object} error - The error object.
|
|
2250
|
+
* @param {Object} response - The privacy list object.
|
|
2338
2251
|
* @callback updatePrivacylistCallback
|
|
2339
2252
|
* */
|
|
2340
2253
|
|
|
@@ -2360,7 +2273,7 @@ PrivacyListProxy.prototype = {
|
|
|
2360
2273
|
},
|
|
2361
2274
|
|
|
2362
2275
|
/**
|
|
2363
|
-
* Get names of privacy lists
|
|
2276
|
+
* Get names of privacy lists({@link https://docs.quickblox.com/docs/js-chat-privacy-list#retrieve-privacy-lists read more}).
|
|
2364
2277
|
* Run without parameters
|
|
2365
2278
|
* @memberof QB.chat.privacylist
|
|
2366
2279
|
* @param {getNamesPrivacylistCallback} callback - The callback function.
|
|
@@ -2368,8 +2281,8 @@ PrivacyListProxy.prototype = {
|
|
|
2368
2281
|
getNames: function(callback) {
|
|
2369
2282
|
/**
|
|
2370
2283
|
* Callback for QB.chat.privacylist.getNames().
|
|
2371
|
-
* @param {Object} error - The error object
|
|
2372
|
-
* @param {Object} response - The privacy list object (var names = response.names;)
|
|
2284
|
+
* @param {Object} error - The error object.
|
|
2285
|
+
* @param {Object} response - The privacy list object (var names = response.names;).
|
|
2373
2286
|
* @callback getNamesPrivacylistCallback
|
|
2374
2287
|
* */
|
|
2375
2288
|
|
|
@@ -2454,7 +2367,7 @@ PrivacyListProxy.prototype = {
|
|
|
2454
2367
|
},
|
|
2455
2368
|
|
|
2456
2369
|
/**
|
|
2457
|
-
* Delete privacy list
|
|
2370
|
+
* Delete privacy list({@link https://docs.quickblox.com/docs/js-chat-privacy-list#remove-privacy-list read more}).
|
|
2458
2371
|
* @param {String} name - The name of privacy list.
|
|
2459
2372
|
* @memberof QB.chat.privacylist
|
|
2460
2373
|
* @param {deletePrivacylistCallback} callback - The callback function.
|
|
@@ -2462,7 +2375,7 @@ PrivacyListProxy.prototype = {
|
|
|
2462
2375
|
delete: function(name, callback) {
|
|
2463
2376
|
/**
|
|
2464
2377
|
* Callback for QB.chat.privacylist.delete().
|
|
2465
|
-
* @param {Object} error - The error object
|
|
2378
|
+
* @param {Object} error - The error object.
|
|
2466
2379
|
* @callback deletePrivacylistCallback
|
|
2467
2380
|
* */
|
|
2468
2381
|
|
|
@@ -2514,7 +2427,7 @@ PrivacyListProxy.prototype = {
|
|
|
2514
2427
|
},
|
|
2515
2428
|
|
|
2516
2429
|
/**
|
|
2517
|
-
* Set as default privacy list
|
|
2430
|
+
* Set as default privacy list({@link https://docs.quickblox.com/docs/js-chat-privacy-list#activate-privacy-list read more}).
|
|
2518
2431
|
* @param {String} name - The name of privacy list.
|
|
2519
2432
|
* @memberof QB.chat.privacylist
|
|
2520
2433
|
* @param {setAsDefaultPrivacylistCallback} callback - The callback function.
|
|
@@ -2522,7 +2435,7 @@ PrivacyListProxy.prototype = {
|
|
|
2522
2435
|
setAsDefault: function(name, callback) {
|
|
2523
2436
|
/**
|
|
2524
2437
|
* Callback for QB.chat.privacylist.setAsDefault().
|
|
2525
|
-
* @param {Object} error - The error object
|
|
2438
|
+
* @param {Object} error - The error object.
|
|
2526
2439
|
* @callback setAsDefaultPrivacylistCallback
|
|
2527
2440
|
* */
|
|
2528
2441
|
|
|
@@ -2568,7 +2481,7 @@ PrivacyListProxy.prototype = {
|
|
|
2568
2481
|
|
|
2569
2482
|
/**
|
|
2570
2483
|
* Set as active privacy list after setting as default.
|
|
2571
|
-
* @param {PrivacyListProxy
|
|
2484
|
+
* @param {PrivacyListProxy} self - Privacy list.
|
|
2572
2485
|
* */
|
|
2573
2486
|
function setAsActive(self) {
|
|
2574
2487
|
var setAsActiveIq,
|
|
@@ -2623,7 +2536,7 @@ Helpers.prototype = {
|
|
|
2623
2536
|
/**
|
|
2624
2537
|
* Get unique id.
|
|
2625
2538
|
* @memberof QB.chat.helpers
|
|
2626
|
-
* @param {String | Number} suffix -
|
|
2539
|
+
* @param {String | Number} suffix - Not required parameter.
|
|
2627
2540
|
* @returns {String} - UniqueId.
|
|
2628
2541
|
* */
|
|
2629
2542
|
getUniqueId: chatUtils.getUniqueId,
|
|
@@ -2669,7 +2582,7 @@ Helpers.prototype = {
|
|
|
2669
2582
|
* @memberof QB.chat.helpers
|
|
2670
2583
|
* @param {Array} occupantsIds - Array of user ids.
|
|
2671
2584
|
* @param {Number} UserId - Jid or user id.
|
|
2672
|
-
* @returns {Number}
|
|
2585
|
+
* @returns {Number} - Recipient id.
|
|
2673
2586
|
* */
|
|
2674
2587
|
getRecipientId: function(occupantsIds, UserId) {
|
|
2675
2588
|
var recipient = null;
|