# HG changeset patch # User Mikael Berthe # Date 1343680757 -7200 # Node ID 26edaf6ea10b8db2ed07da3e4ad9bee03077de84 # Parent d58fb8d7a09a15f8912e2e77378175973075e634 xmpp_setstatus: send presence to MUC rooms before the global presence It only matters (AFAICS) when going offline. We want the presence to be sent by mcabber and not by the server, especially if we're using PGP. diff -r d58fb8d7a09a -r 26edaf6ea10b mcabber/mcabber/xmpp.c --- a/mcabber/mcabber/xmpp.c Sat Jul 28 22:10:33 2012 +0300 +++ b/mcabber/mcabber/xmpp.c Mon Jul 30 22:39:17 2012 +0200 @@ -2029,6 +2029,20 @@ // completely. const char *s_msg = msg; #endif + + if (!recipient) { + // This is a global status, send presence to chatrooms +#ifdef WITH_DEPRECATED_STATUS_INVISIBLE + if (st != invisible) +#endif + { + struct T_presence room_presence; + room_presence.st = st; + room_presence.msg = msg; + foreach_buddy(ROSTER_TYPE_ROOM, &roompresence, &room_presence); + } + } + m = lm_message_new_presence(st, recipient, s_msg); xmpp_insert_entity_capabilities(m->node, st); // Entity Caps (XEP-0115) #ifdef HAVE_GPGME @@ -2050,19 +2064,6 @@ // If we didn't change our _global_ status, we are done if (recipient) return; - if (isonline) { - // Send presence to chatrooms -#ifdef WITH_DEPRECATED_STATUS_INVISIBLE - if (st != invisible) -#endif - { - struct T_presence room_presence; - room_presence.st = st; - room_presence.msg = msg; - foreach_buddy(ROSTER_TYPE_ROOM, &roompresence, &room_presence); - } - } - if (isonline || !st) { // We'll have to update the roster if we switch to/from offline because // we don't know the presences of buddies when offline...