From 49fd8a7ecde2a1ce52d256a340f9971d903016f2 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 5 Mar 2013 22:57:05 +0200 Subject: [PATCH] Fix presence exchange. - Added 'show' element - 'busy' must be 'dnd' --- converse.css | 10 +++------- converse.js | 22 ++++++++++++++-------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/converse.css b/converse.css index 320cb029d..88963d507 100644 --- a/converse.css +++ b/converse.css @@ -43,10 +43,6 @@ padding: 3px 0 3px 7px; } -.chatbox a { - text-decoration: none; -} - .chat-head-chatbox { background-color: rgb(89, 106, 114); background-color: rgba(89, 106, 114, 1); @@ -356,8 +352,8 @@ form.search-xmpp-contact input { background: url(images/user_offline_panel.png) no-repeat 5px 2px; } -#xmppchat-roster dd.current-xmpp-contact.busy, -#xmppchat-roster dd.current-xmpp-contact.busy:hover { +#xmppchat-roster dd.current-xmpp-contact.dnd, +#xmppchat-roster dd.current-xmpp-contact.dnd:hover { background: url(images/user_busy_panel.png) no-repeat 5px 2px; } @@ -634,7 +630,7 @@ input.custom-xmpp-status { background: url(images/user_offline_panel.png) no-repeat left; } -.dropdown a.busy { +.dropdown a.dnd { background: url(images/user_busy_panel.png) no-repeat left; } diff --git a/converse.js b/converse.js index 45e0d0348..d8a15b418 100644 --- a/converse.js +++ b/converse.js @@ -559,7 +559,7 @@ this.insertStatusNotification(fullname+' '+'has gone offline'); } else if (presence_type === 'away') { this.insertStatusNotification(fullname+' '+'has gone away'); - } else if ((presence_type === 'busy') || (presence_type === 'dnd')) { + } else if ((presence_type === 'dnd')) { this.insertStatusNotification(fullname+' '+'is busy'); } else if (presence_type === 'online') { this.$el.find('div.chat-event').remove(); @@ -644,7 +644,7 @@ ''+ ''+ @@ -1419,10 +1419,10 @@ case 'unavailable': rank = 1; break; - case 'away': + case 'xa': rank = 2; break; - case 'busy': + case 'away': rank = 3; break; case 'dnd': @@ -1628,11 +1628,11 @@ if (show.text() === 'chat') { presence_type = 'online'; } else if (show.text() === 'dnd') { - presence_type = 'busy'; + presence_type = 'dnd'; } else if (show.text() === 'xa') { presence_type = 'offline'; } else { - presence_type = show.text(); + presence_type = show.text() || 'online'; } } @@ -1730,7 +1730,7 @@ $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.offline').tsort('a', crit)); $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.unavailable').tsort('a', crit)); $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.away').tsort('a', crit)); - $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.busy').tsort('a', crit)); + $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.dnd').tsort('a', crit)); $my_contacts.after($my_contacts.siblings('dd.current-xmpp-contact.online').tsort('a', crit)); } @@ -1781,7 +1781,13 @@ }, sendPresence: function (type) { - xmppchat.connection.send($pres({'type':type})); + if (type === 'unavailable') { + xmppchat.connection.send($pres({'type':type})); + } else if (type === 'online') { + xmppchat.connection.send($pres()); + } else { + xmppchat.connection.send($pres().c('show').t(type)); + } }, getStatus: function () {