]> code.citadel.org Git - citadel.git/commitdiff
5.51
authorArt Cancro <ajc@citadel.org>
Wed, 27 Jan 1999 03:17:33 +0000 (03:17 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 27 Jan 1999 03:17:33 +0000 (03:17 +0000)
citadel/ChangeLog
citadel/IAFA-PACKAGE
citadel/citadel.c
citadel/citadel.h
citadel/citadel.lsm
citadel/copyright.txt
citadel/msgbase.c

index 71dbbadff6e9d1cbbf0c8a637bc2db909f9f6c30..183d3455bee6387ceaae8c8f3517b215b7a26f2b 100644 (file)
@@ -1,3 +1,7 @@
+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.
index f8ac36c294e9fb6a3cc615e04af7ac7380808dd8..f4cb82cc409aea4a3a1d74df6a2c979d772ccacf 100644 (file)
@@ -1,5 +1,5 @@
 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,
index 9dc5ba4c37a59059e2a5f17a78e0dbc670456489..36a5b172f3e5087725f884e7591507ca3451c35c 100644 (file)
@@ -275,39 +275,32 @@ void remove_march(char *roomname, int floornum)
 
 
 /*
- * 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;
index e524711d97a96a702331db2e16a09732d901823d..29a2e3290c7790148e927eeac4ad1822fd39301b 100644 (file)
@@ -8,7 +8,7 @@
 #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 */
index 43f91800899d5863156bbe4504e1563fd5e067e3..d9a76423a83c88928f11fff3000a7692f19f6929 100644 (file)
@@ -1,7 +1,7 @@
 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
index b622e16fbd308dfb6452c889f33d870088fd8130..8a2a1cc37ae9cf3a1193275d16062626c231360b 100644 (file)
@@ -1,4 +1,4 @@
-                         Citadel/UX release 5.51
+                         Citadel/UX release 5.52
 
 Copyright (c) 1987-1999 by:
         Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
index 8cdcf8b6a36d0a9d51545c5af839f06d7235a5ea..fb6c82c59273830431e3b3bb66691405f7a2045e 100644 (file)
@@ -760,13 +760,14 @@ void copy_file(char *from, char *to)
  */
 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;
@@ -780,6 +781,8 @@ void save_message(char *mtmp,       /* file containing proper message */
        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)
@@ -815,21 +818,29 @@ void save_message(char *mtmp,     /* file containing proper message */
                }
 
        /* ...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);