]> code.citadel.org Git - citadel.git/blobdiff - citadel/file_ops.c
Added the OPNA command for downloading attachments
[citadel.git] / citadel / file_ops.c
index 965c45b103966a261fa6c41c14dcb3b1373d7efd..e808766696e6f1eca7bcb63a37854b72cffd60e9 100644 (file)
@@ -19,6 +19,7 @@
 #include "support.h"
 #include "room_ops.h"
 #include "msgbase.h"
+#include "tools.h"
 
 void cmd_delf(char *filename)
 {
@@ -219,7 +220,7 @@ void cmd_netf(char *cmdbuf)
        fclose(ofp);
 
        cprintf("%d File '%s' has been sent to %s.\n",OK,filename,destsys);
-       system("nohup ./netproc >/dev/null 2>&1 &");
+       system("nohup ./netproc -i >/dev/null 2>&1 &");
        return;
        }
 
@@ -228,11 +229,12 @@ void cmd_netf(char *cmdbuf)
  * It examines the file and displays the OK result code and some information
  * about the file.  NOTE: this stuff is Unix dependent.
  */
-void OpenCmdResult(void) {
+void OpenCmdResult(char *filename, char *mime_type) {
        struct stat statbuf;
 
        fstat(fileno(CC->download_fp), &statbuf);
-       cprintf("%d %ld|%ld\n", OK, statbuf.st_size, statbuf.st_mtime);
+       cprintf("%d %ld|%ld|%s|%s\n", OK, statbuf.st_size, statbuf.st_mtime,
+                                       filename, mime_type);
        }
 
 
@@ -281,7 +283,7 @@ void cmd_open(char *cmdbuf)
                return;
                }
 
-       OpenCmdResult();
+       OpenCmdResult(filename, "application/octet-stream");
        }
 
 /*
@@ -341,7 +343,7 @@ void cmd_oimg(char *cmdbuf)
                return;
                }
        
-       OpenCmdResult();
+       OpenCmdResult(pathname, "image/gif");
        }
 
 /*
@@ -557,7 +559,7 @@ void cmd_ucls(char *cmd)
                fprintf(fp,"NEW UPLOAD: '%s'\n %s\n",CC->upl_file,CC->upl_comment);
                putc(0,fp);
                fclose(fp);
-               save_message(CC->temp, "", 0, M_LOCAL, 1);
+               save_message(CC->temp, "", "", M_LOCAL, 1);
 
                }
        else {