strcpy(CC->cs_clientname, "Jabber session");
CC->session_specific_data = malloc(sizeof(struct citxmpp));
memset(XMPP, 0, sizeof(struct citxmpp));
+ XMPP->last_event_processed = queue_event_seq;
/* XMPP does not use a greeting, but we still have to initialize some things. */
};
extern struct xmpp_event *xmpp_queue;
+extern int queue_event_seq;
enum {
XMPP_EVT_LOGIN,
*/
void jabber_wholist_presence_dump(void)
{
- struct CitContext *cptr;
+ struct CitContext *cptr = NULL;
int aide = (CC->user.axlevel >= 6);
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if (IsEmptyStr(presence_jid)) return;
lprintf(CTDL_DEBUG, "Sending presence info about <%s> to session %d\n", presence_jid, CC->cs_pid);
- /* Transmit an unsolicited roster update
+ /* Transmit an unsolicited roster update */
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if (!strcasecmp(cptr->cs_inet_email, presence_jid)) {
cprintf("<iq id=\"unsolicited_%x\" type=\"result\">", ++unsolicited_id);
cprintf("</query>"
"</iq>");
}
- } */
+ }
- /* Now transmit unsolicited presence information
+ /* Now transmit unsolicited presence information */
cprintf("<presence type=\"%s\" from=\"%s\"></presence>", presence_type, presence_jid);
- */
}
#include <expat.h>
#include "serv_xmpp.h"
-
+int queue_event_seq = 0;
void xmpp_queue_event(int event_type, char *email_addr) {
- static int seq = 0;
struct xmpp_event *xptr = NULL;
struct xmpp_event *new_event = NULL;
struct xmpp_event *last = NULL;
new_event = (struct xmpp_event *) malloc(sizeof(struct xmpp_event));
new_event->next = NULL;
new_event->event_time = time(NULL);
- new_event->event_seq = ++seq;
+ new_event->event_seq = ++queue_event_seq;
new_event->event_type = event_type;
new_event->session_which_generated_this_event = CC->cs_pid;
safestrncpy(new_event->event_jid, email_addr, sizeof new_event->event_jid);