Commit 29c822a6 authored by JC Brand's avatar JC Brand

Possible fix for issue #175.

Make sure contact's chat_status attr is saved.

Updates #175
parent 04d2b3ae
...@@ -3181,8 +3181,6 @@ ...@@ -3181,8 +3181,6 @@
if (this.isSelf(bare_jid)) { if (this.isSelf(bare_jid)) {
if ((converse.connection.jid !== jid)&&(presence_type !== 'unavailable')) { if ((converse.connection.jid !== jid)&&(presence_type !== 'unavailable')) {
// Another resource has changed it's status, we'll update ours as well. // 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}); converse.xmppstatus.save({'status': chat_status});
} }
return true; return true;
...@@ -3202,13 +3200,13 @@ ...@@ -3202,13 +3200,13 @@
} else if (presence_type === 'unavailable') { } else if (presence_type === 'unavailable') {
if (this.removeResource(bare_jid, resource) === 0) { if (this.removeResource(bare_jid, resource) === 0) {
if (item) { if (item) {
item.set({'chat_status': 'offline'}); item.save({'chat_status': 'offline'});
} }
} }
} else if (item) { } else if (item) {
// presence_type is undefined // presence_type is undefined
this.addResource(bare_jid, resource); this.addResource(bare_jid, resource);
item.set({'chat_status': chat_status}); item.save({'chat_status': chat_status});
} }
return true; return true;
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<meta name="description" content="Converse.js: A free chat client for your website" /> <meta name="description" content="Converse.js: A free chat client for your website" />
<meta name="author" content="JC Brand" /> <meta name="author" content="JC Brand" />
<meta name="keywords" content="xmpp chat webchat converse.js" /> <meta name="keywords" content="xmpp chat webchat converse.js" />
<link type="text/css" rel="stylesheet" media="screen" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" /> <link type="text/css" rel="stylesheet" media="screen" href="components/bootstrap/dist/css/bootstrap.min.css" />
<link type="text/css" rel="stylesheet" media="screen" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" /> <link type="text/css" rel="stylesheet" media="screen" href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" /> <link type="text/css" rel="stylesheet" media="screen" href="css/theme.css" />
<link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" /> <link type="text/css" rel="stylesheet" media="screen" href="css/converse.css" />
......
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