/*
* XMPP (Jabber) service for the Citadel system
- * Copyright (c) 2007-2019 by Art Cancro and citadel.org
+ * Copyright (c) 2007-2021 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 as published by
#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
-
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-
+#include <time.h>
#include <sys/wait.h>
#include <string.h>
#include <limits.h>
#include "database.h"
#include "msgbase.h"
#include "internet_addressing.h"
-#include "md5.h"
#include "ctdl_module.h"
#include "serv_xmpp.h"
}
/* Generate the "full JID" of the client (user@host/resource) */
- snprintf(XMPP->client_jid, sizeof XMPP->client_jid, "%s/%s", CC->cs_inet_email, XMPP->iq_client_resource);
+ snprintf(XMPP->client_jid, sizeof XMPP->client_jid, "%s/%s", CC->cs_principal_id, XMPP->iq_client_resource);
/* Tell the client what its JID is */
cprintf("<iq type=\"result\" id=\"%s\">", xmlesc(xmlbuf, XMPP->iq_id, sizeof xmlbuf));
* Login hook for XMPP sessions
*/
void xmpp_login_hook(void) {
- xmpp_queue_event(XMPP_EVT_LOGIN, CC->cs_inet_email);
+ xmpp_queue_event(XMPP_EVT_LOGIN, CC->cs_principal_id);
}
* Logout hook for XMPP sessions
*/
void xmpp_logout_hook(void) {
- xmpp_queue_event(XMPP_EVT_LOGOUT, CC->cs_inet_email);
+ xmpp_queue_event(XMPP_EVT_LOGOUT, CC->cs_principal_id);
}
const char *CitadelServiceXMPP="XMPP";
-extern void xmpp_cleanup_events(void);
CTDL_MODULE_INIT(xmpp)
{
if (!threading) {
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_LOGOUT, PRIO_LOGOUT + 90);
CtdlRegisterSessionHook(xmpp_login_hook, EVT_UNSTEALTH, PRIO_UNSTEALTH + 1);
CtdlRegisterSessionHook(xmpp_logout_hook, EVT_STEALTH, PRIO_STEALTH + 1);
- CtdlRegisterCleanupHook(xmpp_cleanup_events);
}