X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_query_namespace.c;fp=citadel%2Fmodules%2Fxmpp%2Fxmpp_query_namespace.c;h=df7671798a280cbccf6f04756c08fb5845315ca0;hp=8482b4b81b2b5cecc037cddb7161e8e51cf4fea2;hb=2dea277848e779e7a923c9b4c8b98414d41abbda;hpb=6d2eb0194d859fbc6a31ea2c5a8b4e1624070e0a diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index 8482b4b81..df7671798 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -79,7 +79,7 @@ void xmpp_iq_roster_query(void) int nContexts, i; syslog(LOG_DEBUG, "Roster push!"); - cprintf(""); + cprintf(""); cptr = CtdlGetContextArray(&nContexts); if (cptr) { for (i=0; iclient_jid, sizeof(dom)); // result stanza is "from" - it wants the - if (IsEmptyStr(dom)) { // same domain that the user's jid is in. - safestrncpy(dom, XMPP->server_name, sizeof(dom)); + if (!strcasecmp(query_xmlns, "jabber:iq:roster:query")) { + reply_must_be_from_my_jid = 1; } - char *at = strrchr(dom, '@'); - if (at) { - strcpy(dom, ++at); + + char dom[1024]; // client is expecting to see the reply + if (reply_must_be_from_my_jid) { // coming "from" the user's jid + safestrncpy(dom, XMPP->client_jid, sizeof(dom)); + char *slash = strchr(dom, '/'); + if (slash) { + *slash = 0; + } } - char *slash = strchr(dom, '/'); - if (slash) { - *slash = 0; + else { + safestrncpy(dom, XMPP->client_jid, sizeof(dom)); // client is expecting to see the reply + if (IsEmptyStr(dom)) { // coming "from" the domain of the user's jid + safestrncpy(dom, XMPP->server_name, sizeof(dom)); + } + char *at = strrchr(dom, '@'); + if (at) { + strcpy(dom, ++at); + } + char *slash = strchr(dom, '/'); + if (slash) { + *slash = 0; + } } if (supported_namespace) {