X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fxmpp_query_namespace.c;h=e7b01f8a298b0b3683240b763beeca1a690a4484;hb=7a9b0685e406cc83597171cc39d008c7e5459ca8;hp=fba04f75f0408ac02ef210b34e132bc72029bd70;hpb=d7641387790e83fd3a5163202b0fe5f9cc279fe4;p=citadel.git diff --git a/citadel/modules/xmpp/xmpp_query_namespace.c b/citadel/modules/xmpp/xmpp_query_namespace.c index fba04f75f..e7b01f8a2 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. @@ -21,18 +21,7 @@ #include #include #include - -#if TIME_WITH_SYS_TIME -# include -# include -#else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - +#include #include #include #include @@ -45,7 +34,6 @@ #include "support.h" #include "config.h" #include "internet_addressing.h" -#include "md5.h" #include "ctdl_module.h" #include "serv_xmpp.h" @@ -58,10 +46,10 @@ void xmpp_roster_item(struct CitContext *cptr) { char xmlbuf2[256]; cprintf("", - xmlesc(xmlbuf1, cptr->cs_inet_email, sizeof xmlbuf1), + xmlesc(xmlbuf1, cptr->cs_principal_id, 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 +66,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("" "" ""