void jabber_wholist_presence_dump(void)
{
struct CitContext *cptr = NULL;
+ int nContexts, i;
+
int aide = (CC->user.axlevel >= 6);
- for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (cptr->logged_in) {
+ cptr = CtdlGetContextArray(&nContexts);
+ if (!cptr)
+ return ; /** FIXME: Does jabber need to send something to maintain the protocol? */
+
+ for (i=0; i<nContexts; i++) {
+ if (cptr[i].logged_in) {
if (
- (((cptr->cs_flags&CS_STEALTH)==0) || (aide)) /* aides see everyone */
- && (cptr->user.usernum != CC->user.usernum) /* don't show myself */
+ (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide)) /* aides see everyone */
+ && (cptr[i].user.usernum != CC->user.usernum) /* don't show myself */
) {
cprintf("<presence type=\"available\" from=\"%s\"></presence>",
- cptr->cs_inet_email);
+ cptr[i].cs_inet_email);
}
}
}
+ free(cptr);
}
void jabber_iq_roster_query(void)
{
struct CitContext *cptr;
+ int nContexts, i;
int aide = (CC->user.axlevel >= 6);
cprintf("<query xmlns=\"jabber:iq:roster\">");
- for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
- if (cptr->logged_in) {
+ cptr = CtdlGetContextArray(&nContexts);
+ if (!cptr)
+ return ; /** FIXME: Does jabber need to send something to maintain the protocol? */
+
+ for (i=0; i<nContexts; i++) {
+ if (cptr[i].logged_in) {
if (
- (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
- && (cptr->user.usernum != CC->user.usernum)
+ (((cptr[i].cs_flags&CS_STEALTH)==0) || (aide))
+ && (cptr[i].user.usernum != CC->user.usernum)
) {
- jabber_roster_item(cptr);
+ jabber_roster_item(&cptr[i]);
}
}
}
-
+ free (cptr);
cprintf("</query>");
}
end_critical_section(S_XMPP_QUEUE);
/* Tell the sessions that something is happening */
+ begin_critical_section(S_SESSION_TABLE);
for (cptr = ContextList; cptr != NULL; cptr = cptr->next) {
if ((cptr->logged_in) && (cptr->h_async_function == xmpp_async_loop)) {
cptr->async_waiting = 1;
}
}
+ end_critical_section(S_SESSION_TABLE);
}