#include "config.h"
#include "control.h"
#include "user_ops.h"
-#include "policy.h"
#include "database.h"
#include "msgbase.h"
#include "internet_addressing.h"
*/
void do_extnotify_queue(void)
{
+
NotifyContext Ctx;
static int doing_queue = 0;
int i = 0;
+ CitContext extnotifyCC;
/*
* This is a simple concurrency check to make sure only one queue run
*/
if (doing_queue) return;
doing_queue = 1;
+
+ /* Give this thread its own private CitContext */
+ CtdlFillSystemContext(&extnotifyCC, "extnotify");
+ citthread_setspecific(MyConKey, (void *)&extnotifyCC );
/*
* Go ahead and run the queue
Ctx.NotifyHostList = GetNotifyHosts();
if (CtdlGetRoom(&CC->room, FNBL_QUEUE_ROOM) != 0) {
CtdlLogPrintf(CTDL_ERR, "Cannot find room <%s>\n", FNBL_QUEUE_ROOM);
+ CtdlClearSystemContext();
return;
}
CtdlForEachMessage(MSGS_ALL, 0L, NULL,
CtdlLogPrintf(CTDL_DEBUG, "serv_extnotify: queue run completed\n");
doing_queue = 0;
+ CtdlClearSystemContext();
}
/*!
* \brief Process messages in the external notification queue
int a;
// Get the user
- getuser(&user, username);
+ CtdlGetUser(&user, username);
- MailboxName(configRoomName, sizeof configRoomName, &user, USERCONFIGROOM);
+ CtdlMailboxName(configRoomName, sizeof configRoomName, &user, USERCONFIGROOM);
// Fill qrbuf
CtdlGetRoom(&qrbuf, configRoomName);
/* Do something really, really stoopid here. Raid the room on ourselves,