]> code.citadel.org Git - citadel.git/commitdiff
* Altered the display and conversion of RFC822 messages
authorArt Cancro <ajc@citadel.org>
Wed, 16 Feb 2000 22:06:27 +0000 (22:06 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 16 Feb 2000 22:06:27 +0000 (22:06 +0000)
citadel/ChangeLog
citadel/messages.c
citadel/msgbase.c
citadel/sysdep.c

index e305f4f7288315d6b582512104a6f96e21f54233..abea45655199d766533cb89fecf4cdacd5e8407b 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 1.461  2000/02/16 22:06:26  ajc
+* Altered the display and conversion of RFC822 messages
+
 Revision 1.460  2000/02/16 03:43:28  ajc
 * Added the resolver library to the configure script
 
@@ -1629,3 +1632,4 @@ 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 aea57cde6825d638e38f442d373473d97e13ae2f..eb25421a8c95a2d4f8383a56bb9d893be0553d45 100644 (file)
@@ -342,6 +342,7 @@ int read_message(long int num, char pagin) /* Read a message from the server */
        int format_type = 0;
        int fr = 0;
        int nhdr = 0;
+       int have_rfca = 0;
 
        sigcaught = 0;
        sttybbs(1);
@@ -358,6 +359,7 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                }
 
        strcpy(m_subject,"");
+       strcpy(reply_to, "nobody ... xxxxx");
        printf("\n");
        ++lines_printed;
        lines_printed = checkpagin(lines_printed,pagin,screenheight);
@@ -378,7 +380,6 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                return(0);
                }
 
-       strcpy(reply_to,"nobody...xxxxx");
        while(serv_gets(buf), struncmp(buf,"text",4)) {
                if (!struncmp(buf,"nhdr=yes",8)) nhdr=1;
                if (!struncmp(buf,"from=",5)) {
@@ -405,6 +406,8 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                        strcpy(m_subject,&buf[5]);
 
                if (!struncmp(buf,"rfca=",5)) {
+                       strcpy(reply_to, &buf[5]);
+                       have_rfca = 1;
                        color(DIM_WHITE);
                        printf("<");
                        color(BRIGHT_BLUE);
@@ -413,7 +416,8 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                        printf("> ");
                        }
                if ((!struncmp(buf,"hnod=",5)) 
-                  && (strucmp(&buf[5],serv_info.serv_humannode))) {
+                  && (strucmp(&buf[5],serv_info.serv_humannode))
+                  && (have_rfca == 0) ) {
                        color(DIM_WHITE);
                        printf("(");
                        color(BRIGHT_WHITE);
@@ -422,7 +426,8 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                        printf(") ");
                        }
                if ((!struncmp(buf,"room=",5))
-                  && (strucmp(&buf[5],room_name))) {
+                  && (strucmp(&buf[5],room_name)) 
+                  && (have_rfca == 0)) {
                        color(DIM_WHITE);
                        printf("in ");
                        color(BRIGHT_MAGENTA);
@@ -432,18 +437,22 @@ int read_message(long int num, char pagin) /* Read a message from the server */
                if (!struncmp(buf,"node=",5)) {
                        if ( (room_flags&QR_NETWORK)
                           || ((strucmp(&buf[5],serv_info.serv_nodename)
-                          &&(strucmp(&buf[5],serv_info.serv_fqdn)))))
+                          &&(strucmp(&buf[5],serv_info.serv_fqdn)))) ) 
                                {
-                               color(DIM_WHITE);
-                               printf("@");
-                               color(BRIGHT_YELLOW);
-                               printf("%s ",&buf[5]);
+                               if (have_rfca == 0) {
+                                       color(DIM_WHITE);
+                                       printf("@");
+                                       color(BRIGHT_YELLOW);
+                                       printf("%s ",&buf[5]);
                                }
-                       if ((!strucmp(&buf[5],serv_info.serv_nodename))
+                       }
+                       if (have_rfca == 0) {
+                        if ((!strucmp(&buf[5],serv_info.serv_nodename))
                           ||(!strucmp(&buf[5],serv_info.serv_fqdn)))
                                {
                                strcpy(reply_to,from);
                                }
+                       }
                        else {
                                sprintf(reply_to,"%s @ %s",from,&buf[5]);
                                }
index 6b4e645a434e5cf04e85a7c3f6cfe3c8ea5c31d8..132b09e57dbef0090e6fa812328ad6277646f6d9 100644 (file)
@@ -28,6 +28,7 @@
 #include "tools.h"
 #include "mime_parser.h"
 #include "html.h"
+#include "genstamp.h"
 
 #define desired_section ((char *)CtdlGetUserData(SYM_DESIRED_SECTION))
 #define ma ((struct ma_info *)CtdlGetUserData(SYM_MA_INFO))
@@ -747,9 +748,8 @@ int CtdlOutputMsg(long msg_num,             /* message number (local) to fetch */
                int do_proto,           /* do Citadel protocol responses? */
                int crlf                /* Use CRLF newlines instead of LF? */
 ) {
-       int a, i, k;
+       int i, k;
        char buf[1024];
-       time_t xtime;
        CIT_UBYTE ch;
        char allkeys[256];
        char display_name[256];
@@ -764,6 +764,7 @@ int CtdlOutputMsg(long msg_num,             /* message number (local) to fetch */
        char snode[256];
        char lnode[256];
        char mid[256];
+       char datestamp[256];
        /*                                       */
 
        lprintf(7, "CtdlOutputMsg() msgnum=%ld, mode=%d\n", 
@@ -910,16 +911,12 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
 
                                if (i == 'A') {
                                        strcpy(luser, mptr);
-                               } else if (i == 'P') {
-                                       cprintf("Path: %s%s", mptr, nl);
-                                       for (a = 0; a < strlen(mptr); ++a) {
-                                               if (mptr[a] == '!') {
-                                                       strcpy(mptr, &mptr[a + 1]);
-                                                       a = 0;
-                                               }
-                                       }
                                        strcpy(suser, mptr);
-                               } else if (i == 'U')
+                               }
+                               else if (i == 'P') {
+                                       cprintf("Path: %s%s", mptr, nl);
+                               }
+                               else if (i == 'U')
                                        cprintf("Subject: %s%s", mptr, nl);
                                else if (i == 'I')
                                        strcpy(mid, mptr);
@@ -933,13 +930,19 @@ int CtdlOutputMsg(long msg_num,           /* message number (local) to fetch */
                                else if (i == 'R')
                                        cprintf("To: %s%s", mptr, nl);
                                else if (i == 'T') {
-                                       xtime = atol(mptr);
-                                       cprintf("Date: %s", asctime(localtime(&xtime)));
+                                       generate_rfc822_datestamp(datestamp,
+                                                               atol(mptr) );
+                                       cprintf("Date: %s%s", datestamp, nl);
                                }
                        }
                }
        }
 
+       for (i=0; i<strlen(suser); ++i) {
+               suser[i] = tolower(suser[i]);
+               if (!isalnum(suser[i])) suser[i]='_';
+       }
+
        if (mode == MT_RFC822) {
                if (!strcasecmp(snode, NODENAME)) {
                        strcpy(snode, FQDN);
index 5c613031302115215174eecb1c8d4a761a31afa0..10852678b65e194c46d73a43cbcd1eeb6c6a5e9c 100644 (file)
@@ -956,9 +956,6 @@ void worker_thread(void) {
 
        ++num_threads;
 
-       tv.tv_sec = 60;         /* wake up every minute if no input */
-       tv.tv_usec = 0;
-
        while (!time_to_die) {
 
                /* 
@@ -984,6 +981,8 @@ SETUP_FD:   memcpy(&readfds, &masterfds, sizeof(fd_set) );
                }
                end_critical_section(S_SESSION_TABLE);
 
+               tv.tv_sec = 60;         /* wake up every minute if no input */
+               tv.tv_usec = 0;
                retval = select(highest + 1, &readfds, NULL, NULL, &tv);
 
                /* Now figure out who made this select() unblock.