X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_query_namespace.c;h=0a8c3b7a3f78d9388c8266bc60361c1472b57f77;hb=3144440e07822224c1967203c77ca3ef0f419e43;hp=fba04f75f0408ac02ef210b34e132bc72029bd70;hpb=164b2f28587681f406dd12dbc4a3c82e70775726;p=citadel.git diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index fba04f75f..0a8c3b7a3 100644 --- a/citadel/modules/xmpp/xmpp_query_namespace.c +++ b/citadel/modules/xmpp/xmpp_query_namespace.c @@ -1,7 +1,7 @@ /* * Handle type situations (namespace queries) * - * Copyright (c) 2007-2009 by Art Cancro + * Copyright (c) 2007-2015 by Art Cancro and citadel.org * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -61,7 +61,7 @@ void xmpp_roster_item(struct CitContext *cptr) { xmlesc(xmlbuf1, cptr->cs_inet_email, sizeof xmlbuf1), xmlesc(xmlbuf2, cptr->user.fullname, sizeof xmlbuf2) ); - cprintf("%s", xmlesc(xmlbuf1, config.c_humannode, sizeof xmlbuf1)); + cprintf("%s", xmlesc(xmlbuf1, CtdlGetConfigStr("c_humannode"), sizeof xmlbuf1)); cprintf(""); } @@ -78,13 +78,13 @@ void xmpp_iq_roster_query(void) struct CitContext *cptr; int nContexts, i; - syslog(LOG_DEBUG, "Roster push!"); + syslog(LOG_DEBUG, "xmpp: roster push!"); cprintf(""); cptr = CtdlGetContextArray(&nContexts); if (cptr) { for (i=0; iclient_jid, sizeof(dom)); + 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) { - cprintf("\n", query_xmlns); + syslog(LOG_DEBUG, "xmpp: unknown query namespace '%s' - returning ", query_xmlns); cprintf("" "" ""