Mercurial > ~mikael > mcabber > hg
diff mcabber/src/jabglue.c @ 444:5927c3bfba13
Add /status_to command
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 25 Sep 2005 00:33:56 +0200 |
parents | 51b8f10cfeb8 |
children | 03bb57383cea |
line wrap: on
line diff
--- a/mcabber/src/jabglue.c Thu Sep 22 19:27:13 2005 +0200 +++ b/mcabber/src/jabglue.c Sun Sep 25 00:33:56 2005 +0200 @@ -158,7 +158,7 @@ if (!jc) return; // announce it to everyone else - jb_setstatus(offline, ""); + jb_setstatus(offline, NULL, ""); // announce it to the user statehandler(jc, JCONN_STATE_OFF); @@ -255,7 +255,7 @@ return mystatus; } -void jb_setstatus(enum imstatus st, const char *msg) +void jb_setstatus(enum imstatus st, const char *recipient, const char *msg) { xmlnode x; gchar *utf8_msg; @@ -264,6 +264,9 @@ x = jutil_presnew(JPACKET__UNKNOWN, 0, 0); + if (recipient) + xmlnode_put_attrib(x, "to", recipient); + switch(st) { case away: xmlnode_insert_cdata(xmlnode_insert_tag(x, "show"), "away", @@ -315,7 +318,11 @@ xmlnode_free(x); g_free(utf8_msg); - //sendvisibility(); ??? + // If we didn't change our _global_ status, we are done + if (recipient) return; + + // Buddy per buddy invisibility handling + //sendvisibility(); // We'll need to update the roster if we switch to/from offline because // we don't know the presences of buddies when offline... @@ -464,7 +471,7 @@ //setautostatus(jhook.manualstatus); - jb_setstatus(available, NULL); + jb_setstatus(available, NULL, NULL); buddylist_build(); /* for (i = 0; i < clist.count; i++) {