#include "config.h"
#include "msgbase.h"
#include "user_ops.h"
-#include "room_ops.h"
#ifndef HAVE_SNPRINTF
#include "snprintf.h"
struct imlog *imlist = NULL;
+
+
+
+/*
+ * FIXME: OMG this module is realy horrible to the rest of the system when accessing contexts.
+ * It pays no regard at all to how long it may have the context list locked for.
+ * It carries out IO whilst the context list is locked.
+ * I'd recomend disabling this module altogether for the moment.
+ */
+
/*
* This function handles the logging of instant messages to disk.
*/
}
-t_context *find_context(char **unstr)
+CitContext *find_context(char **unstr)
{
- t_context *t_cc, *found_cc = NULL;
+ CitContext *t_cc, *found_cc = NULL;
char *name, *tptr;
if ((!*unstr) || (!unstr))
CtdlInvtKick(CC->user.fullname, 0);
/* And return to the Lobby */
- usergoto(config.c_baseroom, 0, 0, NULL, NULL);
+ CtdlUserGoto(config.c_baseroom, 0, 0, NULL, NULL);
return;
}
}
cprintf("Message ");
cprintf("from %s:\n", ptr->sender);
if (ptr->text != NULL)
- memfmout(ptr->text, 0, "\n");
+ memfmout(ptr->text, "\n");
holdptr = ptr->next;
if (ptr->text != NULL) free(ptr->text);
);
if (ptr->text != NULL) {
- memfmout(ptr->text, 0, "\n");
+ memfmout(ptr->text, "\n");
if (ptr->text[strlen(ptr->text)-1] != '\n') cprintf("\n");
free(ptr->text);
}
/* If the target context is a session which can handle asynchronous
* messages, go ahead and set the flag for that.
*/
- if (ccptr->is_async) {
- ccptr->async_waiting = 1;
- if (ccptr->state == CON_IDLE) {
- ccptr->state = CON_READY;
- }
- }
+ set_async_waiting(ccptr);
}
if (!strcmp(x_msg, "-")) {
message_sent = PerformXmsgHooks(lun, lem, x_user, "");
if (message_sent == 0) {
- if (getuser(NULL, x_user))
+ if (CtdlGetUser(NULL, x_user))
cprintf("%d '%s' does not exist.\n",
ERROR + NO_SUCH_USER, x_user);
else
cprintf(" to %d users", message_sent);
cprintf(".\n");
} else {
- if (getuser(NULL, x_user))
+ if (CtdlGetUser(NULL, x_user))
cprintf("%d '%s' does not exist.\n",
ERROR + NO_SUCH_USER, x_user);
else
* prefix will be created. That's ok because the auto-purger will clean it up later.
*/
snprintf(roomname, sizeof roomname, "%010ld.%s", im->usernums[1], PAGELOGROOM);
- create_room(roomname, 5, "", 0, 1, 1, VIEW_BBS);
+ CtdlCreateRoom(roomname, 5, "", 0, 1, 1, VIEW_BBS);
msgnum = CtdlSubmitMsg(msg, NULL, roomname, 0);
CtdlFreeMessage(msg);
/* If there is a valid user number in usernums[0], save a copy for them too. */
if (im->usernums[0] > 0) {
snprintf(roomname, sizeof roomname, "%010ld.%s", im->usernums[0], PAGELOGROOM);
- create_room(roomname, 5, "", 0, 1, 1, VIEW_BBS);
+ CtdlCreateRoom(roomname, 5, "", 0, 1, 1, VIEW_BBS);
CtdlSaveMsgPointerInRoom(roomname, msgnum, 0, NULL);
}
/* Finally, if we're logging instant messages globally, do that now. */
if (!IsEmptyStr(config.c_logpages)) {
- create_room(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
+ CtdlCreateRoom(config.c_logpages, 3, "", 0, 1, 1, VIEW_BBS);
CtdlSaveMsgPointerInRoom(config.c_logpages, msgnum, 0, NULL);
}