* More changes to support attachments. They mostly work, but only
authorArt Cancro <ajc@citadel.org>
Wed, 23 Sep 1998 17:43:54 +0000 (17:43 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 23 Sep 1998 17:43:54 +0000 (17:43 +0000)
          in fixed-format messages.

citadel/ChangeLog
citadel/msgbase.c
citadel/msgbase.h
citadel/techdoc/session.txt

index efa0fa574c760c38ea82db89f1680e79e6579f20..edb93cdfc53f76cb9d99fc53dcd8482cf4268376 100644 (file)
@@ -1,3 +1,7 @@
+Wed Sep 23 13:41:49 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * More changes to support attachments.  They mostly work, but only
+         in fixed-format messages.
+
 Mon Sep 21 21:19:17 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * msgbase.c: began laying the groundwork to support attachments.
          Purchased Rogaine(tm) in preparation for expected hair loss.
index db5bd7d938bac83a788c198f9b215d253f588354..9df77031a346aa775dfab3d4c879b8466b8326f3 100644 (file)
@@ -312,8 +312,8 @@ FMTEND:     cprintf("\n");
  * get a message off disk.
  * 
  */
-void output_message(char *msgid, int mode, int headers_only)
-{
+void output_message(char *msgid, int mode,
+                       int headers_only, int desired_section) {
        long msg_num;
        int a;
        CIT_UBYTE ch, rch;
@@ -323,7 +323,6 @@ void output_message(char *msgid, int mode, int headers_only)
        int msg_ok = 0;
        char boundary[256];             /* attachment boundary */
        char current_section = 0;       /* section currently being parsed */
-       char desired_section = 0;       /* section desired for printing */
        int has_attachments = 0;
 
        struct cdbdata *dmsgtext;
@@ -571,11 +570,13 @@ void cmd_msg0(char *cmdbuf)
 {
        char msgid[256];
        int headers_only = 0;
+       int desired_section = 0;
 
        extract(msgid,cmdbuf,0);
-       headers_only = extract_int(cmdbuf,1);
+       headers_only = extract_int(cmdbuf, 1);
+       desired_section = extract_int(cmdbuf, 2);
 
-       output_message(msgid,MT_CITADEL,headers_only);
+       output_message(msgid,MT_CITADEL, headers_only, desired_section);
        }
 
 
@@ -590,7 +591,7 @@ void cmd_msg2(char *cmdbuf)
        extract(msgid,cmdbuf,0);
        headers_only = extract_int(cmdbuf,1);
 
-       output_message(msgid,MT_RFC822,headers_only);
+       output_message(msgid,MT_RFC822,headers_only,0);
        }
 
 /* 
@@ -610,7 +611,7 @@ void cmd_msg3(char *cmdbuf)
        extract(msgid,cmdbuf,0);
        headers_only = extract_int(cmdbuf,1);
 
-       output_message(msgid,MT_RAW,headers_only);
+       output_message(msgid,MT_RAW,headers_only,0);
        }
 
 
index ce041b50b94cc6b99db5a25277a8e44346cedbdb..c1708fb572622e65055f54af24ca0af7eaf461d5 100644 (file)
@@ -4,7 +4,8 @@ void cmd_msgs (char *cmdbuf);
 void help_subst (char *strbuf, char *source, char *dest);
 void do_help_subst (char *buffer);
 void memfmout (int width, char *mptr, char subst);
-void output_message (char *msgid, int mode, int headers_only);
+void output_message (char *msgid, int mode,
+                       int headers_only, int desired_section);
 void cmd_msg0 (char *cmdbuf);
 void cmd_msg2 (char *cmdbuf);
 void cmd_msg3 (char *cmdbuf);
index 2df5208d0f106d7dfde699d02bf01cd2ed1f8bcc..b91ee2d9ab6fa51ea55377c093d4548ef296f61a 100644 (file)
@@ -424,7 +424,9 @@ other MSG commands (MSG1, MSG2, etc.) will probably be added later on to read
 messages in more robust formats.  This command should be passed two arguments.
 The first is the message number of the message being requested.  In server 
 version 4.04 and above, the second argument may be set to either 0 to read the
-entire message, or 1 to read the headers only.
+entire message, or 1 to read the headers only.  In server version 6.00 and
+above, the third argument may be set to the desired section of the message (if
+there are attachments).
  
  The server should, of course, make sure that the client actually has access
 to the message being requested before honoring this request.  Citadel/UX does