ekiga r6313 - in trunk: . src/endpoints src/gui
- From: dsandras svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6313 - in trunk: . src/endpoints src/gui
- Date: Sat, 24 May 2008 14:42:55 +0000 (UTC)
Author: dsandras
Date: Sat May 24 14:42:55 2008
New Revision: 6313
URL: http://svn.gnome.org/viewvc/ekiga?rev=6313&view=rev
Log:
Added custom presence message support in the PIDF.
Modified:
trunk/ChangeLog
trunk/src/endpoints/sip.cpp
trunk/src/gui/statusmenu.cpp
Modified: trunk/src/endpoints/sip.cpp
==============================================================================
--- trunk/src/endpoints/sip.cpp (original)
+++ trunk/src/endpoints/sip.cpp Sat May 24 14:42:55 2008
@@ -206,10 +206,9 @@
GMSIPEndpoint::publish (const Ekiga::PersonalDetails & details)
{
std::string hostname = (const char *) PIPSocket::GetHostName ();
- // TODO: move this code outside of this class and allow a
- // more complete document
- // TODO: add support for long status
- std::string status = ((Ekiga::PersonalDetails &) (details)).get_short_status ();
+ std::string short_status = ((Ekiga::PersonalDetails &) (details)).get_short_status ();
+ std::string long_status = ((Ekiga::PersonalDetails &) (details)).get_long_status ();
+
for (std::list<std::string>::iterator it = aors.begin ();
it != aors.end ();
it++) {
@@ -228,7 +227,9 @@
data += "\">\r\n";
data += "<note>";
- data += status.c_str ();
+ data += short_status.c_str ();
+ data += " - ";
+ data += long_status.c_str ();
data += "</note>\r\n";
data += "<status>\r\n";
@@ -891,10 +892,10 @@
const PString & basic,
const PString & note)
{
+ PINDEX j;
PCaselessString b = basic;
PCaselessString s = note;
- // TODO long status
std::string status;
std::string presence = "presence-unknown";
@@ -902,31 +903,25 @@
sip_uri.AdjustForRequestURI ();
std::string _uri = sip_uri.AsString ();
- if (b.Find ("Closed") != P_MAX_INDEX) {
+ if (b.Find ("Closed") != P_MAX_INDEX)
presence = "presence-offline";
- }
- else {
+ else
presence = "presence-online";
- }
- if (s.Find ("Away") != P_MAX_INDEX) {
+ if (s.Find ("Away") != P_MAX_INDEX)
presence = "presence-away";
- status = _("Away");
- }
else if (s.Find ("On the phone") != P_MAX_INDEX
- || s.Find ("Ringing") != P_MAX_INDEX) {
+ || s.Find ("Ringing") != P_MAX_INDEX)
presence = "presence-inacall";
- status = _("In A Call");
- }
else if (s.Find ("dnd") != P_MAX_INDEX
- || s.Find ("Do Not Disturb") != P_MAX_INDEX) {
+ || s.Find ("Do Not Disturb") != P_MAX_INDEX)
presence = "presence-dnd";
- status = _("Do Not Disturb");
- }
- else if (s.Find ("Free For Chat") != P_MAX_INDEX) {
+
+ else if (s.Find ("Free For Chat") != P_MAX_INDEX)
presence = "presence-freeforchat";
- status = _("Free For Chat");
- }
+
+ if ((j = s.Find (" - ")) != P_MAX_INDEX)
+ status = (const char *) note.Mid (j + 3);
/**
* TODO
Modified: trunk/src/gui/statusmenu.cpp
==============================================================================
--- trunk/src/gui/statusmenu.cpp (original)
+++ trunk/src/gui/statusmenu.cpp Sat May 24 14:42:55 2008
@@ -292,17 +292,17 @@
{
case TYPE_ONLINE:
gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "online");
- gm_conf_set_string (PERSONAL_DATA_KEY "long_status", statuses[TYPE_ONLINE]);
+ gm_conf_set_string (PERSONAL_DATA_KEY "long_status", "");
break;
case TYPE_AWAY:
gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "away");
- gm_conf_set_string (PERSONAL_DATA_KEY "long_status", statuses[TYPE_AWAY]);
+ gm_conf_set_string (PERSONAL_DATA_KEY "long_status", "");
break;
case TYPE_DND:
gm_conf_set_string (PERSONAL_DATA_KEY "short_status", "dnd");
- gm_conf_set_string (PERSONAL_DATA_KEY "long_status", statuses[TYPE_DND]);
+ gm_conf_set_string (PERSONAL_DATA_KEY "long_status", "");
break;
case TYPE_CUSTOM_ONLINE:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]