X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fmodules%2Fxmpp%2Fserv_xmpp.c;h=e0b61af64413e38b7978d4b42d0f5388cd2ef71a;hb=df8fe1be788cd4193b9e213009b665b47f1ed385;hp=cc75f6dd190751d88f112fa6c91035277d28c2d2;hpb=5e630368347015f99043c6edbc8c1b474cf892ff;p=citadel.git diff --git a/citadel/modules/xmpp/serv_xmpp.c b/citadel/modules/xmpp/serv_xmpp.c index cc75f6dd1..e0b61af64 100644 --- a/citadel/modules/xmpp/serv_xmpp.c +++ b/citadel/modules/xmpp/serv_xmpp.c @@ -414,15 +414,16 @@ void xmpp_xml_end(void *data, const char *supplied_el) { /* Generate the "full JID" of the client resource */ - snprintf(XMPP->client_jid, sizeof XMPP->client_jid, - "%s/%s", - CC->cs_inet_email, - XMPP->iq_client_resource - ); - - /* FIXME look here ... there's nothing before the slash ... wtf? - syslog(LOG_DEBUG, "\033[31m client resource = '%s' \033[0m", XMPP->client_jid); - */ + if (IsEmptyStr(CC->cs_inet_email)) { // synthetic user@host if no email is set + snprintf(XMPP->client_jid, sizeof XMPP->client_jid, + "%ld@%s/%s", CC->user.usernum, CtdlGetConfigStr("c_fqdn"), XMPP->iq_client_resource + ); + } + else { // use the email address if we have it + snprintf(XMPP->client_jid, sizeof XMPP->client_jid, + "%s/%s", CC->cs_inet_email, XMPP->iq_client_resource + ); + } /* Tell the client what its JID is */