From 0aca9ef3c22d7814567ddc3107c83b810234365a Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sat, 19 Jul 2014 23:54:52 +0200 Subject: [PATCH] Possible fix for issue #175. Make sure contact's chat_status attr is saved. Updates #175 --- converse.js | 6 ++---- index.html | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/converse.js b/converse.js index 2f8f2ac7a..2fba66cc8 100644 --- a/converse.js +++ b/converse.js @@ -3178,8 +3178,6 @@ if (this.isSelf(bare_jid)) { if ((converse.connection.jid !== jid)&&(presence_type !== 'unavailable')) { // Another resource has changed it's status, we'll update ours as well. - // FIXME: We should ideally differentiate between converse.js using - // resources and other resources (i.e Pidgin etc.) converse.xmppstatus.save({'status': chat_status}); } return true; @@ -3199,13 +3197,13 @@ } else if (presence_type === 'unavailable') { if (this.removeResource(bare_jid, resource) === 0) { if (item) { - item.set({'chat_status': 'offline'}); + item.save({'chat_status': 'offline'}); } } } else if (item) { // presence_type is undefined this.addResource(bare_jid, resource); - item.set({'chat_status': chat_status}); + item.save({'chat_status': chat_status}); } return true; } diff --git a/index.html b/index.html index 51959cc84..207111529 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ - +