From: Art Cancro Date: Mon, 10 May 2010 20:36:54 +0000 (+0000) Subject: * Changed the logic of how we inform the client about dead buddies. Instead of pushi... X-Git-Tag: v7.86~217 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=885291b9d18f551e88d3b6c7349f99c92985c152 * Changed the logic of how we inform the client about dead buddies. Instead of pushing a dead buddy update at login, we push it immediately following any roster query requested by the client. I discovered that some clients don't bother to query the roster if an unsolicited update is recived. This is working more reliably now. However, I'm not getting any asynchronous updates; must check this... --- diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/modules/xmpp/serv_xmpp.c index c553f2419..8c7297350 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/modules/xmpp/serv_xmpp.c @@ -508,11 +508,6 @@ void xmpp_async_loop(void) { */ void xmpp_login_hook(void) { xmpp_queue_event(XMPP_EVT_LOGIN, CC->cs_inet_email); - - /* only do the protocol stuff if this is an XMPP session */ - if (CC->h_command_function == xmpp_command_loop) { - xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(); - } } diff --git a/citadel/modules/xmpp/xmpp_presence.c b/citadel/modules/xmpp/xmpp_presence.c index ebb3576c2..e53b26cc0 100644 --- a/citadel/modules/xmpp/xmpp_presence.c +++ b/citadel/modules/xmpp/xmpp_presence.c @@ -126,6 +126,7 @@ void xmpp_destroy_buddy(char *presence_jid) { if (!XMPP) return; if (!XMPP->client_jid) return; + CtdlLogPrintf(CTDL_DEBUG, "\033[31mdestroy_buddy(%s)\033[0m\n", presence_jid); /* Transmit non-presence information */ cprintf("", presence_jid, XMPP->client_jid diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index 47f2237d7..45bc9ed8e 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -62,6 +62,7 @@ * Output a single roster item, for roster queries or pushes */ void xmpp_roster_item(struct CitContext *cptr) { + CtdlLogPrintf(CTDL_DEBUG, "\033[32mxmpp_roster_item(%s)\033[0m\n", cptr->cs_inet_email); cprintf("", cptr->cs_inet_email, cptr->user.fullname @@ -82,12 +83,14 @@ void xmpp_iq_roster_query(void) struct CitContext *cptr; int nContexts, i; - cprintf(""); + CtdlLogPrintf(CTDL_DEBUG, "\033[36m ROSTER QUERY !! \033[0m\n"); + cprintf(""); cptr = CtdlGetContextArray(&nContexts); if (cptr) { for (i=0; i"); + + /* If we told the client who is on the roster, we also need to tell the client + * who is *not* on the roster. (It's down here because we can't do it in the same + * stanza; this will be an unsolicited push.) + */ + if (roster_query) { + xmpp_delete_old_buddies_who_no_longer_exist_from_the_client_roster(); + } }