+Mon Jan 25 21:23:07 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+ * Fixed bug in save_message() which crashed the server on mail to sysop
+ * Rewrote pop_march() to be smarter about <G>oto heuristics
+
Sat Jan 23 14:32:19 EST 1999 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Changed internal storage of express messages from a linked list to
a single, resizable buffer.
Title: Citadel/UX
-Version: 5.51
+Version: 5.52
Description: An advanced messaging system which can be used for BBS,
groupware, and
online community applications. It is multithreaded,
/*
- * Locate the room on the march list which we most want to go to
+ * Locate the room on the march list which we most want to go to. Each room
+ * is measured given a "weight" of preference based on various factors.
*/
char *pop_march(int desired_floor) {
static char TheRoom[ROOMNAMELEN];
int TheFloor = 0;
int TheOrder = 32767;
+ int TheWeight = 0;
+ int weight;
struct march *mptr = NULL;
strcpy(TheRoom, "_BASEROOM_");
if (march == NULL) return(TheRoom);
for (mptr = march; mptr != NULL; mptr = mptr->next) {
- if ((strcasecmp(mptr->march_name, "_BASEROOM_"))
- &&(!strcasecmp(TheRoom, "_BASEROOM_"))) {
- strcpy(TheRoom, mptr->march_name);
- TheFloor = mptr->march_floor;
- TheOrder = mptr->march_order;
- }
- else if ( (mptr->march_floor == desired_floor)
- && (TheFloor != desired_floor)
- && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
- strcpy(TheRoom, mptr->march_name);
- TheFloor = mptr->march_floor;
- TheOrder = mptr->march_order;
- }
- else if ((mptr->march_floor < TheFloor)
- && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
- strcpy(TheRoom, mptr->march_name);
- TheFloor = mptr->march_floor;
- TheOrder = mptr->march_order;
- }
- else if ((mptr->march_order < TheOrder)
- && (strcasecmp(mptr->march_name, "_BASEROOM_")) ) {
+ weight = 0;
+ if ((strcasecmp(mptr->march_name, "_BASEROOM_")))
+ weight = weight + 10000;
+ if (mptr->march_floor == desired_floor)
+ weight = weight + 5000;
+
+ weight = weight + ((128-(mptr->march_floor))*128);
+ weight = weight + (128-(mptr->march_order));
+
+ if (weight > TheWeight) {
+ TheWeight = weight;
strcpy(TheRoom, mptr->march_name);
TheFloor = mptr->march_floor;
TheOrder = mptr->march_order;
#include "sysdep.h"
#include "sysconfig.h"
#include "ipcdef.h"
-#define CITADEL "Citadel/UX 5.51"
+#define CITADEL "Citadel/UX 5.52"
#define REV_LEVEL 551
#define SERVER_TYPE 0 /* zero for stock Citadel/UX; other developers please
obtain SERVER_TYPE codes for your implementations */
Begin3
Title: Citadel/UX
-Version: 5.51
-Entered-date: Thu Jan 14 17:57:43 EST 1999
+Version: 5.52
+Entered-date: Tue Jan 26 22:16:47 EST 1999
Description: An advanced messaging system which can be used for BBS,
groupware, and online community applications. It is
multithreaded, client/server, database driven, and
- Citadel/UX release 5.51
+ Citadel/UX release 5.52
Copyright (c) 1987-1999 by:
Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
*/
void save_message(char *mtmp, /* file containing proper message */
char *rec, /* Recipient (if mail) */
- char *force_room, /* if non-zero length, force a room */
+ char *force, /* if non-zero length, force a room */
int mailtype, /* local or remote type, see citadel.h */
int generate_id) /* set to 1 to generate an 'I' field */
{
char aaa[100];
char hold_rm[ROOMNAMELEN];
char actual_rm[ROOMNAMELEN];
+ char force_room[ROOMNAMELEN];
char recipient[256];
long newmsgid;
char *message_in_memory;
lprintf(9, "save_message(%s,%s,%s,%d,%d)\n",
mtmp, rec, force_room, mailtype, generate_id);
+ strcpy(force_room, force);
+
/* Strip non-printable characters out of the recipient name */
strcpy(recipient, rec);
for (a=0; a<strlen(recipient); ++a)
}
/* ...or if this is a private message, go to the target mailbox. */
+ lprintf(9, "mailbox aliasing loop\n");
+lprintf(9, "1\n");
if (strlen(recipient) > 0) {
+lprintf(9, "2\n");
/* mailtype = alias(recipient); */
if (mailtype == M_LOCAL) {
+lprintf(9, "3\n");
if (getuser(&userbuf, recipient)!=0) {
/* User not found, goto Aide */
+lprintf(9, "4\n");
strcpy(force_room, AIDEROOM);
}
else {
+lprintf(9, "5\n");
strcpy(hold_rm, actual_rm);
+lprintf(9, "6\n");
MailboxName(actual_rm, &userbuf, MAILROOM);
}
}
}
/* ...or if this message is destined for Aide> then go there. */
+ lprintf(9, "actual room forcing loop\n");
if (strlen(force_room) > 0) {
strcpy(hold_rm, actual_rm);
strcpy(actual_rm, force_room);