* Bugfixes and cosmetic changes to listsub system
authorArt Cancro <ajc@citadel.org>
Sat, 24 Aug 2002 05:59:24 +0000 (05:59 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 24 Aug 2002 05:59:24 +0000 (05:59 +0000)
citadel/ChangeLog
citadel/citserver.c
citadel/internet_addressing.c
citadel/msgbase.c
citadel/serv_listsub.c
citadel/serv_network.c
citadel/server.h
webcit/ChangeLog
webcit/listsub.c

index 873dcc5deb40fb84d1459f6905f61648d274e9db..1e9ac65e4f929d5349f5b1d0a5ed0148586c65c9 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 591.100  2002/08/24 05:58:53  ajc
+ * Bugfixes and cosmetic changes to listsub system
+
  Revision 591.99  2002/08/23 03:36:52  ajc
  * Finished all of the subscribe/unsubscribe/confirm stuff!
 
@@ -3929,4 +3932,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
-
index 42201f7bb2eba17fcd697d44228dbe4fdc239faa..2e47ffc8504e64ab0165795feb499442f5fbc6ee 100644 (file)
@@ -210,11 +210,6 @@ void RemoveContext (struct CitContext *con)
        
        syslog(LOG_NOTICE,"session %d: ended", con->cs_pid);
 
-       /* If we have a message in cache, free it */
-       if (CC->cached_msg != NULL) {
-               phree(CC->cached_msg);
-       }
-       
        /* Deallocate any user-data attached to this session */
        deallocate_user_data(con);
 
index 6c1be48e1efe3680947a61f3367b089a87a92f4b..bdc259f97eb26c9199c009e1b461640eb6271156 100644 (file)
@@ -620,8 +620,6 @@ int CtdlDirectoryLookup(char *target, char *internet_addr) {
        struct cdbdata *cdbrec;
        char key[SIZ];
 
-       lprintf(9, "CtdlDirectoryLookup(%s)\n", internet_addr);
-
        if (IsDirectory(internet_addr) == 0) return(-1);
 
        directory_key(key, internet_addr);
@@ -629,10 +627,8 @@ int CtdlDirectoryLookup(char *target, char *internet_addr) {
        if (cdbrec != NULL) {
                safestrncpy(target, cdbrec->ptr, SIZ);
                cdb_free(cdbrec);
-               lprintf(9, "Looked up as <%s>\n", target);
                return(0);
        }
 
-       lprintf(9, "Lookup failed\n");
        return(-1);
 }
index 94405b53fc5465d02a5a869fdb6d75bca9eb4cc2..d73875df59ff5bed13f547ec74ac3d03f1149a14 100644 (file)
@@ -1056,21 +1056,9 @@ int CtdlOutputMsg(long msg_num,          /* message number (local) to fetch */
         */
 
        /*
-        * Fetch the message from disk.  We also keep the most recently
-        * read message in memory, in case we want to read it again, or fetch
-        * MIME parts out of it, or whatever.
+        * Fetch the message from disk.
         */
-       if ( (CC->cached_msg != NULL) && (CC->cached_msgnum == msg_num) ) {
-               TheMessage = CC->cached_msg;
-       }
-       else {
-               TheMessage = CtdlFetchMessage(msg_num);
-               if (CC->cached_msg != NULL) {
-                       phree(CC->cached_msg); /* FIXME efence? */
-               }
-               CC->cached_msg = TheMessage;
-               CC->cached_msgnum = msg_num;
-       }
+       TheMessage = CtdlFetchMessage(msg_num);
 
        if (TheMessage == NULL) {
                if (do_proto) cprintf("%d Can't locate msg %ld on disk\n",
@@ -1082,8 +1070,7 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
                        TheMessage, msg_num, mode,
                        headers_only, do_proto, crlf);
 
-       /* don't free the memory; we're keeping it in the cache */
-       /* CtdlFreeMessage(TheMessage); */
+       CtdlFreeMessage(TheMessage);
 
        return(retcode);
 }
index 179014548c9388d26a0a2ac4dd3852505192965c..7fdee6b0b133865253063d15c7ae2c7cc0ca8812 100644 (file)
@@ -324,13 +324,8 @@ void do_confirm(char *room, char *token) {
        char *holdbuf = NULL;
        int linelen = 0;
        int buflen = 0;
-       char success_message[SIZ];
-       char success_message_to[SIZ];
-       char address_of_list[SIZ];
-       int i;
 
        strcpy(address_to_unsubscribe, "");
-       strcpy(success_message_to, "");
 
        if (getroom(&qrbuf, room) != 0) {
                cprintf("%d There is no list called '%s'\n",
@@ -345,26 +340,6 @@ void do_confirm(char *room, char *token) {
                return;
        }
 
-       /*
-        * We'll just have this success message ready if we need it
-        */
-       sprintf(address_of_list, "room_%s@%s", qrbuf.QRname, config.c_fqdn);
-       for (i=0; i<strlen(address_of_list); ++i) {
-               if (isspace(address_of_list[i])) {
-                       address_of_list[i] = '_';
-               }
-       }
-       snprintf(success_message, sizeof success_message,
-               "Content-type: text/html\n\n"
-               "<HTML><BODY>"
-               "You have successfully subscribed to the <B>%s</B>\n"
-               "mailing list.<BR><BR>To post to the list, simply send "
-               "an e-mail to <TT>%s</TT>"
-               "</BODY></HTML>\n",
-               qrbuf.QRname,
-               address_of_list
-       );
-
        /*
         * Now start scanning this room's netconfig file for the
         * specified token.
@@ -401,7 +376,6 @@ void do_confirm(char *room, char *token) {
                                        fseek(ncfp, line_offset, SEEK_SET);
                                        fprintf(ncfp, "%s\n", buf);
                                        ++success;
-                                       strcpy(success_message_to, email);
                                }
                        }
                        if (!strcasecmp(cmd, "unsubpending")) {
@@ -471,18 +445,6 @@ void do_confirm(char *room, char *token) {
                phree(holdbuf);
        }
 
-       /* Let 'em know it succeeded, and how to post to the list. */
-       if (strlen(success_message_to) > 0) {
-               quickie_message(
-                       "Citadel",
-                       success_message_to,
-                       NULL,
-                       success_message,
-                       FMT_RFC822,
-                       "Your subscription is complete"
-               );
-       }
-
        /*
         * Did we do anything useful today?
         */
index 2624b9d3371ecb97d08484c8c124af67a7014a09..5694055b8e16f386f7f847495e7e7cabbd4c3a4c 100644 (file)
@@ -694,6 +694,7 @@ void network_spoolout_room(char *room_to_spool) {
        size_t miscsize = 0;
        size_t linesize = 0;
        int skipthisline = 0;
+       int i;
 
        lprintf(7, "Spooling <%s>\n", room_to_spool);
        if (getroom(&CC->quickroom, room_to_spool) != 0) {
@@ -787,13 +788,20 @@ void network_spoolout_room(char *room_to_spool) {
                network_spool_msg, &sc);
 
        /* If we wrote a digest, deliver it and then close it */
+       snprintf(buf, sizeof buf, "room_%s@%s",
+               CC->quickroom.QRname, config.c_fqdn);
+       for (i=0; i<strlen(buf); ++i) {
+               buf[i] = tolower(buf[i]);
+               if (isspace(buf[i])) buf[i] = '_';
+       }
        if (sc.digestfp != NULL) {
                fprintf(sc.digestfp,    " -----------------------------------"
                                        "------------------------------------"
                                        "-------\n"
                                        "You are subscribed to the '%s' "
-                                       "list.\n",
-                                       CC->quickroom.QRname
+                                       "list.\n"
+                                       "To post to the list: %s\n",
+                                       CC->quickroom.QRname, buf
                );
                network_deliver_digest(&sc);    /* deliver and close */
        }
index ab8d07e7bb18bb72358e4e113286b6abf9595619..81932e2ec3a464de480b9fd68ae96f16d6f5a5a9 100644 (file)
@@ -145,8 +145,6 @@ struct CitContext {
        char fake_hostname[64];                 /* Fake hostname <bc> */
        char fake_roomname[ROOMNAMELEN];        /* Fake roomname <bc> */
 
-       struct CtdlMessage *cached_msg;
-       long cached_msgnum;
        char preferred_formats[SIZ];            /* Preferred MIME formats */
 
        /* Dynamically allocated session data */
index 8a5c570422133f74d29b4065a44e87fa29363a7e..0ef8467c6a9516fb2362a9f7e2b8b00ed6785f61 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 323.63  2002/08/24 05:59:24  ajc
+* Bugfixes and cosmetic changes to listsub system
+
 Revision 323.62  2002/08/23 03:37:19  ajc
 * Finished all of the subscribe/unsubscribe/confirm stuff!  (I think)
 
@@ -913,3 +916,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 40b87a162e6a020e108519a9f4d3fc58b666f587..a4c90d09075697f5b812dcd21bd2f9c823de1649 100644 (file)
@@ -141,7 +141,17 @@ void do_listsub(void)
                        wprintf("<CENTER><H1>Confirmation successful!</H1>");
                }
                else {
-                       wprintf("<CENTER><H1>Confirmation failed.</H1>");
+                       wprintf("<CENTER><H1>Confirmation failed.</H1>"
+                               "This could mean one of two things:<UL>\n"
+                               "<LI>You waited too long to confirm your "
+                               "subscribe/unsubscribe request (the "
+                               "confirmation link is only valid for three "
+                               "days)\n<LI>You have <i>already</i> "
+                               "successfully confirmed your "
+                               "subscribe/unsubscribe request and are "
+                               "attempting to do it again.</UL>\n"
+                               "The error returned by the server was: "
+                       );
                }
                wprintf("%s</CENTER><BR>\n", &buf[4]);
        }