From 0c980556d34dbc4ed8ba38d2257999f7391b8a6b Mon Sep 17 00:00:00 2001 From: Mikael Berthe Date: Sat, 19 Mar 2011 13:06:23 +0100 Subject: [PATCH] Remove deprecated status invisible --- mcabber/mcabber/commands.c | 8 +++++++- mcabber/mcabber/xmpp.c | 17 ++++++++++++++++- mcabber/mcabber/xmpp_helper.c | 2 ++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/mcabber/mcabber/commands.c b/mcabber/mcabber/commands.c index bb46186..f7a1487 100644 --- a/mcabber/mcabber/commands.c +++ b/mcabber/mcabber/commands.c @@ -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 @@ void cmd_init(void) // 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 @@ void cmd_setstatus(const char *recipient, const char *arg) 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; diff --git a/mcabber/mcabber/xmpp.c b/mcabber/mcabber/xmpp.c index 0832834..0eb8776 100644 --- a/mcabber/mcabber/xmpp.c +++ b/mcabber/mcabber/xmpp.c @@ -488,7 +488,9 @@ void xmpp_send_msg(const char *fjid, const char *text, int type, #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 @@ void xmpp_setstatus(enum imstatus st, const char *recipient, const char *msg, // (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 @@ void xmpp_setstatus(enum imstatus st, const char *recipient, const char *msg, 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 @@ void xmpp_setstatus(enum imstatus st, const char *recipient, const char *msg, 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; } diff --git a/mcabber/mcabber/xmpp_helper.c b/mcabber/mcabber/xmpp_helper.c index c83e68d..da08d6d 100644 --- a/mcabber/mcabber/xmpp_helper.c +++ b/mcabber/mcabber/xmpp_helper.c @@ -304,9 +304,11 @@ LmMessage *lm_message_new_presence(enum imstatus st, 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"); -- 2.11.4.GIT