* more fixes, offset in URLS is different now, since we strip the command.
[citadel.git] / webcit / messages.c
index 0a9f2c746b332965191e670047f4f336ddb74e81..055fae22cbc4ae478dd6014da4593279727a048a 100644 (file)
@@ -426,7 +426,7 @@ void embed_message(void) {
        const StrBuf *Tmpl;
        StrBuf *CmdBuf = NULL;
 
-       msgnum = StrBufExtract_long(WCC->Hdr->ReqLine, 2, '/');
+       msgnum = StrBufExtract_long(WCC->Hdr->ReqLine, 0, '/');
        switch (WCC->Hdr->eReqType)
        {
        case eGET:
@@ -466,7 +466,7 @@ void print_message(void) {
        long msgnum = 0L;
        const StrBuf *Mime;
 
-       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 2, '/');
+       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 0, '/');
        output_headers(0, 0, 0, 0, 0, 0);
 
        hprintf("Content-type: text/html\r\n"
@@ -490,7 +490,7 @@ void mobile_message_view(void)
        long msgnum = 0L;
        const StrBuf *Mime;
   
-       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 2, '/');
+       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 0, '/');
        output_headers(1, 0, 0, 0, 0, 1);
        begin_burst();
        do_template("msgcontrols", NULL);
@@ -507,7 +507,7 @@ void display_headers(void) {
        long msgnum = 0L;
        char buf[1024];
 
-       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 2, '/');
+       msgnum = StrBufExtract_long(WC->Hdr->ReqLine, 0, '/');
        output_headers(0, 0, 0, 0, 0, 0);
 
        hprintf("Content-type: text/plain\r\n"
@@ -1738,8 +1738,8 @@ void mimepart(int force_download)
        StrBuf *ContentType = NewStrBufPlain(HKEY("application/octet-stream"));
        const char *CT;
 
-       msgnum = StrBufExtract_long(WCC->Hdr->ReqLine, 2, '/');
-       att = StrBufExtract_long(WCC->Hdr->ReqLine, 3, '/');
+       msgnum = StrBufExtract_long(WCC->Hdr->ReqLine, 0, '/');
+       att = StrBufExtract_long(WCC->Hdr->ReqLine, 1, '/');
 
        Buf = NewStrBuf();
        serv_printf("OPNA %ld|%ld", msgnum, att);
@@ -1758,7 +1758,7 @@ void mimepart(int force_download)
 
                if (!force_download) {
                        if (!strcasecmp(ChrPtr(ContentType), "application/octet-stream")) {
-                               StrBufExtract_token(Buf, WCC->Hdr->ReqLine, 4, '/');
+                               StrBufExtract_token(Buf, WCC->Hdr->ReqLine, 2, '/');
                                CT = GuessMimeByFilename(SKEY(Buf));
                        }
                        if (!strcasecmp(ChrPtr(ContentType), "application/octet-stream")) {
@@ -1845,8 +1845,8 @@ void view_postpart(void) {
        StrBuf *filename = NewStrBuf();
        StrBuf *partnum = NewStrBuf();
 
-       StrBufExtract_token(partnum, WC->Hdr->ReqLine, 2, '/');
-       StrBufExtract_token(filename, WC->Hdr->ReqLine, 3, '/');
+       StrBufExtract_token(partnum, WC->Hdr->ReqLine, 0, '/');
+       StrBufExtract_token(filename, WC->Hdr->ReqLine, 1, '/');
 
        postpart(partnum, filename, 0);
 
@@ -1858,8 +1858,8 @@ void download_postpart(void) {
        StrBuf *filename = NewStrBuf();
        StrBuf *partnum = NewStrBuf();
 
-       StrBufExtract_token(partnum, WC->Hdr->ReqLine, 2, '/');
-       StrBufExtract_token(filename, WC->Hdr->ReqLine, 3, '/');
+       StrBufExtract_token(partnum, WC->Hdr->ReqLine, 0, '/');
+       StrBufExtract_token(filename, WC->Hdr->ReqLine, 1, '/');
 
        postpart(partnum, filename, 1);