From: Art Cancro Date: Sat, 24 Aug 2002 05:59:24 +0000 (+0000) Subject: * Bugfixes and cosmetic changes to listsub system X-Git-Tag: v7.86~6279 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=6d86b3d162e6f6879d97d0a62351a4538d41c687 * Bugfixes and cosmetic changes to listsub system --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 873dcc5de..1e9ac65e4 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/citserver.c b/citadel/citserver.c index 42201f7bb..2e47ffc85 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -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); diff --git a/citadel/internet_addressing.c b/citadel/internet_addressing.c index 6c1be48e1..bdc259f97 100644 --- a/citadel/internet_addressing.c +++ b/citadel/internet_addressing.c @@ -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); } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 94405b53f..d73875df5 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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); } diff --git a/citadel/serv_listsub.c b/citadel/serv_listsub.c index 179014548..7fdee6b0b 100644 --- a/citadel/serv_listsub.c +++ b/citadel/serv_listsub.c @@ -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" - "You have successfully subscribed to the %s\n" - "mailing list.

To post to the list, simply send " - "an e-mail to %s" - "\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? */ diff --git a/citadel/serv_network.c b/citadel/serv_network.c index 2624b9d33..5694055b8 100644 --- a/citadel/serv_network.c +++ b/citadel/serv_network.c @@ -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; iquickroom.QRname + "list.\n" + "To post to the list: %s\n", + CC->quickroom.QRname, buf ); network_deliver_digest(&sc); /* deliver and close */ } diff --git a/citadel/server.h b/citadel/server.h index ab8d07e7b..81932e2ec 100644 --- a/citadel/server.h +++ b/citadel/server.h @@ -145,8 +145,6 @@ struct CitContext { char fake_hostname[64]; /* Fake hostname */ char fake_roomname[ROOMNAMELEN]; /* Fake roomname */ - struct CtdlMessage *cached_msg; - long cached_msgnum; char preferred_formats[SIZ]; /* Preferred MIME formats */ /* Dynamically allocated session data */ diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 8a5c57042..0ef8467c6 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 1998-12-03 Nathan Bryant * webserver.c: warning fix + diff --git a/webcit/listsub.c b/webcit/listsub.c index 40b87a162..a4c90d090 100644 --- a/webcit/listsub.c +++ b/webcit/listsub.c @@ -141,7 +141,17 @@ void do_listsub(void) wprintf("

Confirmation successful!

"); } else { - wprintf("

Confirmation failed.

"); + wprintf("

Confirmation failed.

" + "This could mean one of two things:
    \n" + "
  • You waited too long to confirm your " + "subscribe/unsubscribe request (the " + "confirmation link is only valid for three " + "days)\n
  • You have already " + "successfully confirmed your " + "subscribe/unsubscribe request and are " + "attempting to do it again.
\n" + "The error returned by the server was: " + ); } wprintf("%s

\n", &buf[4]); }