* Finished the netproc side of Z (zap/supersede) processing for replication
authorArt Cancro <ajc@citadel.org>
Thu, 14 Oct 1999 03:04:24 +0000 (03:04 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 14 Oct 1999 03:04:24 +0000 (03:04 +0000)
citadel/ChangeLog
citadel/msgbase.c
citadel/netproc.c
citadel/network/mail.sysinfo

index 0d816e2fe5f125e019920fad76300ad3880ccd25..ae050c41466d99aa60a3118ba8b51bbf0f20bf8a 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 1.384  1999/10/14 03:04:16  ajc
+* Finished the netproc side of Z (zap/supersede) processing for replication
+
 Revision 1.383  1999/10/13 04:24:18  ajc
 * Added search-by-header-fields to CtdlForEachMessage(), and then to the
   server MSGS command.  This will have lots of uses.
@@ -1308,4 +1311,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index 341b587cf75bb5a20087e5b360350f4cbd4cf099..c64ca671611e421b622812d96dea76b50fe51d49 100644 (file)
@@ -56,7 +56,7 @@ char *msgkeys[] = {
        "path",
        "",
        "rcpt",
-       ""
+       "",
        "time",
        "subj",
        "",
@@ -730,6 +730,7 @@ void output_message(char *msgid, int mode, int headers_only)
        time_t xtime;
        CIT_UBYTE ch;
        char allkeys[256];
+       char display_name[256];
 
        struct CtdlMessage *TheMessage = NULL;
 
@@ -819,32 +820,41 @@ void output_message(char *msgid, int mode, int headers_only)
 
        if ((mode == MT_CITADEL) || (mode == MT_MIME)) {
 
+               strcpy(display_name, "<unknown>");
                if (TheMessage->cm_fields['A']) {
                        strcpy(buf, TheMessage->cm_fields['A']);
                        PerformUserHooks(buf, (-1L), EVT_OUTPUTMSG);
                        if (TheMessage->cm_anon_type == MES_ANON)
-                               cprintf("from=****");
+                               strcpy(display_name, "****");
                        else if (TheMessage->cm_anon_type == MES_AN2)
-                               cprintf("from=anonymous");
+                               strcpy(display_name, "anonymous");
                        else
-                               cprintf("from=%s", buf);
+                               strcpy(display_name, buf);
                        if ((is_room_aide())
                            && ((TheMessage->cm_anon_type == MES_ANON)
                             || (TheMessage->cm_anon_type == MES_AN2))) {
-                               cprintf(" [%s]", buf);
+                               sprintf(&display_name[strlen(display_name)],
+                                       " [%s]", buf);
                        }
-                       cprintf("\n");
                }
 
                strcpy(allkeys, FORDER);
                for (i=0; i<strlen(allkeys); ++i) {
                        k = (int) allkeys[i];
-                       if ((k != 'A') && (k != 'M')) {
-                               if (TheMessage->cm_fields[k] != NULL)
-                                       cprintf("%s=%s\n",
-                                               msgkeys[k],
-                                               TheMessage->cm_fields[k]
+                       if (k != 'M') {
+                               if (TheMessage->cm_fields[k] != NULL) {
+                                       if (k == 'A') {
+                                               cprintf("%s=%s\n",
+                                                       msgkeys[k],
+                                                       display_name);
+                                       }
+                                       else {
+                                               cprintf("%s=%s\n",
+                                                       msgkeys[k],
+                                                       TheMessage->cm_fields[k]
                                        );
+                                       }
+                               }
                        }
                }
 
@@ -1864,7 +1874,8 @@ void cmd_dele(char *delstr)
        getuser(&CC->usersupp, CC->curr_user);
        if ((CC->usersupp.axlevel < 6)
            && (CC->usersupp.usernum != CC->quickroom.QRroomaide)
-           && ((CC->quickroom.QRflags & QR_MAILBOX) == 0)) {
+           && ((CC->quickroom.QRflags & QR_MAILBOX) == 0)
+           && (!(CC->internal_pgm))) {
                cprintf("%d Higher access required.\n",
                        ERROR + HIGHER_ACCESS_REQUIRED);
                return;
index e1301b607b2b0c74f9a64f3fc231e5bf40812d40..a01ca241e349aa7193b57675734a0be72df6ec3b 100644 (file)
@@ -826,6 +826,8 @@ void process_zaplist(void) {
        char room[256];
        char id[256];
        char node[256];
+       long localzap = 0L;
+       int numzap = 0;
 
        zaplist = fopen(ZAPLIST, "r");
        if (zaplist == NULL) {
@@ -857,18 +859,41 @@ void process_zaplist(void) {
 
                /* And only do the zap if we succeeded */
                if (!strcasecmp(curr_rm, room)) {
-
-
-
-               /* FIX    not finished */
-
-
+               
+                       serv_puts("MSGS ALL|0|1");
+                       serv_gets(buf);
+                       if (buf[0]=='1') {
+                               /* This is bogus, flush and go away */
+                               while (serv_gets(buf), strcmp(buf, "000")) ;
+                       }
+                       else if (buf[0]=='8') {
+                               sprintf(buf, "msgn|%s\nnode|%s\n000",
+                                       id, node);
+                               serv_puts(buf);
+                               numzap = 0;
+                               while (serv_gets(buf), strcmp(buf, "000")) {
+                                       localzap = atol(buf);
+                                       ++numzap;
+                               }
+                       }
+       
+                       if (numzap > 0) {
+                               sprintf(buf, "DELE %ld", localzap);
+                               serv_puts(buf);
+                               serv_gets(buf);
+                               if (buf[0] != '2') {
+                                       syslog(LOG_ERR, "%s", buf);
+                               }
+                       }
+                       if (numzap > 1) {
+                               syslog(LOG_ERR, "Multiple messages are <%s@%s>",
+                                       id, node);
+                       }
+       
                }
-
        }
-
        fclose(zaplist);
-
+       unlink(ZAPLIST);
 }
 
 
index 32f41df907dad32593bc4d623218eb5be4719ea9..52ee2124d55e48719cf7fffad9303575dc49e525 100644 (file)
@@ -1,13 +1,14 @@
-internet
-uum %s
-humannode Internet Gateway
-lastcontact 935635336 Wed Aug 25 22:42:16 1999
+test
+bin Mail
 
 uncnsrd
 bin Mail
-phonenum US 800 555 1212
-humannode My System
-lastcontact 935635337 Wed Aug 25 22:42:17 1999
+phonenum US 914 244 3252
+humannode Uncensored
+lastcontact 939870141 Wed Oct 13 23:02:21 1999
+
+internet
+uum %s
+humannode Internet Gateway
+lastcontact 939870141 Wed Oct 13 23:02:21 1999
 
-test
-bin Mail