Obtain MIME objects using DLAT cmd instead of OPNA where appropriate
authorArt Cancro <ajc@citadel.org>
Sat, 28 Oct 2006 18:17:24 +0000 (18:17 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 28 Oct 2006 18:17:24 +0000 (18:17 +0000)
webcit/vcard_edit.c
webcit/webcit.c

index 187646193a091dad1bc3036bb8b886ce9bae8a00..cb17968a4e56708529e19c72856147226171178d 100644 (file)
@@ -89,21 +89,18 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to) {
                        }
                }
        
-               sprintf(buf, "OPNA %ld|%s", msgnum, partnum);
+               sprintf(buf, "DLAT %ld|%s", msgnum, partnum);
                serv_puts(buf);
                serv_getln(buf, sizeof buf);
-               if (buf[0] != '2') {
+               if (buf[0] != '6') {
                        convenience_page("770000", "Error", &buf[4]);
                        return;
                }
        
                total_len = atoi(&buf[4]);
                serialized_vcard = malloc(total_len + 2);
-       
-               read_server_binary(serialized_vcard, total_len);
 
-               serv_puts("CLOS");
-               serv_getln(buf, sizeof buf);
+               serv_read(serialized_vcard, total_len);
                serialized_vcard[total_len] = 0;
        
                v = vcard_load(serialized_vcard);
index 2cdbbd8aef7479f9962d840acb505e36f86cbe27..1655f53cbf0e996381e0503cede8331b4a2b6c24 100644 (file)
@@ -692,17 +692,15 @@ char *load_mimepart(long msgnum, char *partnum)
        char content_type[SIZ];
        char *content;
        
-       serv_printf("OPNA %ld|%s", msgnum, partnum);
+       serv_printf("DLAT %ld|%s", msgnum, partnum);
        serv_getln(buf, sizeof buf);
-       if (buf[0] == '2') {
+       if (buf[0] == '6') {
                bytes = extract_long(&buf[4], 0);
                extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
 
                content = malloc(bytes + 2);
-               read_server_binary(content, bytes);
+               serv_read(content, bytes);
 
-               serv_puts("CLOS");
-               serv_getln(buf, sizeof buf);
                content[bytes] = 0;     /* null terminate for good measure */
                return(content);
        }