changeset 1972:45f0f0f60656

Remove deprecated status invisible
author Mikael Berthe <mikael@lilotux.net>
date Sat, 19 Mar 2011 13:06:23 +0100
parents 7ea4342044ef
children 9fe1c0a54e73
files mcabber/mcabber/commands.c mcabber/mcabber/xmpp.c mcabber/mcabber/xmpp_helper.c
diffstat 3 files changed, 25 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/commands.c	Sat Mar 19 12:50:04 2011 +0100
+++ b/mcabber/mcabber/commands.c	Sat Mar 19 13:06:23 2011 +0100
@@ -47,10 +47,12 @@
 #define IMSTATUS_ONLINE         "online"
 #define IMSTATUS_OFFLINE        "offline"
 #define IMSTATUS_FREE4CHAT      "free"
-#define IMSTATUS_INVISIBLE      "invisible"
 #define IMSTATUS_AVAILABLE      "avail"
 #define IMSTATUS_NOTAVAILABLE   "notavail"
 #define IMSTATUS_DONOTDISTURB   "dnd"
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
+# define IMSTATUS_INVISIBLE      "invisible"
+#endif
 
 // Return value container for the following functions
 static int retval_for_cmds;
@@ -196,7 +198,9 @@
   // Status category
   compl_add_category_word(COMPL_STATUS, "online");
   compl_add_category_word(COMPL_STATUS, "avail");
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
   compl_add_category_word(COMPL_STATUS, "invisible");
+#endif
   compl_add_category_word(COMPL_STATUS, "free");
   compl_add_category_word(COMPL_STATUS, "dnd");
   compl_add_category_word(COMPL_STATUS, "notavail");
@@ -888,7 +892,9 @@
   else if (!strcasecmp(status, IMSTATUS_ONLINE))        st = available;
   else if (!strcasecmp(status, IMSTATUS_AVAILABLE))     st = available;
   else if (!strcasecmp(status, IMSTATUS_AWAY))          st = away;
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
   else if (!strcasecmp(status, IMSTATUS_INVISIBLE))     st = invisible;
+#endif
   else if (!strcasecmp(status, IMSTATUS_DONOTDISTURB))  st = dontdisturb;
   else if (!strcasecmp(status, IMSTATUS_NOTAVAILABLE))  st = notavail;
   else if (!strcasecmp(status, IMSTATUS_FREE4CHAT))     st = freeforchat;
--- a/mcabber/mcabber/xmpp.c	Sat Mar 19 12:50:04 2011 +0100
+++ b/mcabber/mcabber/xmpp.c	Sat Mar 19 13:06:23 2011 +0100
@@ -488,7 +488,9 @@
 #endif
 
 xmpp_send_msg_no_chatstates:
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
   if (mystatus != invisible)
+#endif
     update_last_use();
   if (xep184 && *xep184) {
     lm_connection_send_with_reply(lconnection, x, *xep184, NULL);
@@ -1931,7 +1933,13 @@
   // (But we want to update internal status even when disconnected,
   // in order to avoid some problems during network failures)
   if (isonline) {
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
     const char *s_msg = (st != invisible ? msg : NULL);
+#else
+    // XXX Could be removed if/when we get rid of status invisible
+    // completely.
+    const char *s_msg = msg;
+#endif
     m = lm_message_new_presence(st, recipient, s_msg);
     xmpp_insert_entity_capabilities(m->node, st); // Entity Caps (XEP-0115)
 #ifdef HAVE_GPGME
@@ -1955,7 +1963,10 @@
 
   if (isonline) {
     // Send presence to chatrooms
-    if (st != invisible) {
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
+    if (st != invisible)
+#endif
+    {
       struct T_presence room_presence;
       room_presence.st = st;
       room_presence.msg = msg;
@@ -1970,7 +1981,11 @@
       update_roster = TRUE;
 
     if (isonline || mystatus || st)
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
       hk_mystatuschange(0, mystatus, st, (st != invisible ? msg : ""));
+#else
+      hk_mystatuschange(0, mystatus, st, msg);
+#endif
     mystatus = st;
   }
 
--- a/mcabber/mcabber/xmpp_helper.c	Sat Mar 19 12:50:04 2011 +0100
+++ b/mcabber/mcabber/xmpp_helper.c	Sat Mar 19 13:06:23 2011 +0100
@@ -304,9 +304,11 @@
         lm_message_node_add_child(x->node, "show", imstatus_showmap[st]);
         break;
 
+#ifdef WITH_DEPRECATED_STATUS_INVISIBLE
     case invisible:
         lm_message_node_set_attribute(x->node, "type", "invisible");
         break;
+#endif
 
     case offline:
         lm_message_node_set_attribute(x->node, "type", "unavailable");