Skip to content

Commit d76faed

Browse files
committed
send auto presence if user received 'unavailable' status from himself
1 parent fd384fd commit d76faed

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

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.2.1",
4+
"version": "2.2.2",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "quickblox.js",
77
"license": "Apache 2.0",

package.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.2.1",
4+
"version": "2.2.2",
55
"homepage": "https://quickblox.com/developers/Javascript",
66
"main": "src/qbMain.js",
77
"license": [

quickblox.min.js

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

src/modules/qbChat.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ function ChatProxy(service, webrtcModule, conn) {
159159

160160
this._onPresence = function(stanza) {
161161
var from = stanza.getAttribute('from'),
162+
to = stanza.getAttribute('to'),
162163
type = stanza.getAttribute('type'),
163-
userId = self.helpers.getIdFromNode(from);
164+
userId = self.helpers.getIdFromNode(from),
165+
currentUserId = self.helpers.getIdFromNode(to);
164166

165167
if (!type) {
166168
if (typeof self.onContactListListener === 'function' && roster[userId] && roster[userId].subscription !== 'none')
@@ -216,8 +218,12 @@ function ChatProxy(service, webrtcModule, conn) {
216218
// self.onRejectSubscribeListener(userId);
217219
break;
218220
case 'unavailable':
219-
if (typeof self.onContactListListener === 'function' && roster[userId] && roster[userId].subscription !== 'none')
221+
if (typeof self.onContactListListener === 'function' && roster[userId] && roster[userId].subscription !== 'none') {
220222
Utils.safeCallbackCall(self.onContactListListener, userId, type);
223+
}
224+
if (userId === currentUserId) {
225+
self._autoSendPresence();
226+
}
221227
break;
222228
}
223229

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.2.1',
13+
version: '2.2.2',
1414
creds: {
1515
appId: '',
1616
authKey: '',

0 commit comments

Comments
 (0)