Commit 3451fcf0 authored by JC Brand's avatar JC Brand

Only set contact status offline if there aren't any other resources available.

parent f399c5f6
...@@ -4040,7 +4040,11 @@ ...@@ -4040,7 +4040,11 @@
} else if (presence_type === 'subscribe') { } else if (presence_type === 'subscribe') {
this.handleIncomingSubscription(jid); this.handleIncomingSubscription(jid);
} else if (presence_type === 'unavailable' && contact) { } else if (presence_type === 'unavailable' && contact) {
contact.save({'chat_status': (contact.removeResource(resource) === 0) ? "offline" : chat_status}); // Only set the user to offline if there aren't any
// other resources still available.
if (contact.removeResource(resource) === 0) {
contact.save({'chat_status': "offline"});
}
} else if (contact) { // presence_type is undefined } else if (contact) { // presence_type is undefined
this.addResource(bare_jid, resource); this.addResource(bare_jid, resource);
contact.save({'chat_status': chat_status}); contact.save({'chat_status': chat_status});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment