* if we need the first urlpart, we musn't move it just left, but add another one...
authorWilfried Göesgens <willi@citadel.org>
Mon, 8 Dec 2008 22:08:25 +0000 (22:08 +0000)
committerWilfried Göesgens <willi@citadel.org>
Mon, 8 Dec 2008 22:08:25 +0000 (22:08 +0000)
webcit/context_loop.c
webcit/downloads.c
webcit/messages.c
webcit/msg_renderers.c
webcit/roomops.c
webcit/webcit.c
webcit/webcit.h

index b7416f0ac10d475e16a4a8fd807eb239b985fdb8..7af1790c1cbf491564e47fb61071ae1fddf11870 100644 (file)
@@ -48,6 +48,7 @@ void DestroySession(struct wcsession **sessions_to_kill)
        DeleteHash(&((*sessions_to_kill)->ServCfg));
        FreeStrBuf(&((*sessions_to_kill)->UrlFragment1));
        FreeStrBuf(&((*sessions_to_kill)->UrlFragment2));
+       FreeStrBuf(&((*sessions_to_kill)->UrlFragment3));
        FreeStrBuf(&((*sessions_to_kill)->WBuf));
        FreeStrBuf(&((*sessions_to_kill)->HBuf));
        FreeStrBuf(&((*sessions_to_kill)->CLineBuf));
index 23bf5f801391e0b410fbd920e3005b4bae7e1ddd..d980ce1d330b674e33d08f4365a9311e6bf21fe0 100644 (file)
@@ -391,7 +391,7 @@ void download_file(void)
        /* Setting to nonzero forces a MIME type of application/octet-stream */
        int force_download = 1;
        
-       safestrncpy(buf, ChrPtr(WC->UrlFragment1), sizeof buf);
+       safestrncpy(buf, ChrPtr(WC->UrlFragment2), sizeof buf);
        unescape_input(buf);
        serv_printf("OPEN %s", buf);
        serv_getln(buf, sizeof buf);
index 0713591e736827ba7a311734b7c93262c3d09f2e..2286a04217fca82b8bac9cf887d2fbc0b3dac3b0 100644 (file)
@@ -249,7 +249,7 @@ void embed_message(void) {
        long msgnum = 0L;
        const StrBuf *Tmpl = sbstr("template");
 
-       msgnum = StrTol(WC->UrlFragment1);
+       msgnum = StrTol(WC->UrlFragment2);
        if (StrLength(Tmpl) > 0) 
                read_message(WC->WBuf, SKEY(Tmpl), msgnum, 0, NULL);
        else 
@@ -265,7 +265,7 @@ void embed_message(void) {
 void print_message(void) {
        long msgnum = 0L;
 
-       msgnum = StrTol(WC->UrlFragment1);
+       msgnum = StrTol(WC->UrlFragment2);
        output_headers(0, 0, 0, 0, 0, 0);
 
        hprintf("Content-type: text/html\r\n"
@@ -286,7 +286,7 @@ void print_message(void) {
  */
 void mobile_message_view(void) {
   long msgnum = 0L;
-  msgnum = StrTol(WC->UrlFragment1);
+  msgnum = StrTol(WC->UrlFragment2);
   output_headers(1, 0, 0, 0, 0, 1);
   begin_burst();
   do_template("msgcontrols", NULL);
@@ -303,7 +303,7 @@ void display_headers(void) {
        long msgnum = 0L;
        char buf[1024];
 
-       msgnum = StrTol(WC->UrlFragment1);
+       msgnum = StrTol(WC->UrlFragment2);
        output_headers(0, 0, 0, 0, 0, 0);
 
        hprintf("Content-type: text/plain\r\n"
index 005288380fe1db905e0835e707f704e524210115..48f32507f012ea84083c4977eb4f9c8dea5fcd05 100644 (file)
@@ -176,8 +176,7 @@ int summcmp_rdate(const void *s1, const void *s2) {
 
 /*----------------------------------------------------------------------------*/
 
-
-
+///void examine_subj(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
 
 void examine_nhdr(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset)
 {
index f8a5e4c0efd872c823e49e915717dadeffe7efd2..35a150e3f2cf55f8de4167b0cce8c48c05090838 100644 (file)
@@ -3201,7 +3201,7 @@ void set_floordiv_expanded(void) {
        StrBuf *FloorDiv;
        
        FloorDiv = NewStrBuf();
-       StrBufAppendBuf(FloorDiv, WCC->UrlFragment1, 0);
+       StrBufAppendBuf(FloorDiv, WCC->UrlFragment2, 0);
        set_preference("floordiv_expanded", FloorDiv, 1);
        WCC->floordiv_expanded = FloorDiv;
 }
index 1bd1e1ee582eaeb17f58b3614d9d4f847961cb62..d6aa8a0d2d26b8f9b7d152b2de6201a14ab8f50e 100644 (file)
@@ -927,7 +927,7 @@ void display_vcard_photo_img(void)
        const char *contentType;
        struct wcsession *WCC = WC;
 
-       msgnum = StrTol(WCC->UrlFragment1);
+       msgnum = StrTol(WCC->UrlFragment2);
        
        vcard = load_mimepart(msgnum,"1");
        v = vcard_load(vcard);
@@ -1811,8 +1811,11 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method
                                                WCC->UrlFragment1 = NewStrBuf();
                                        if (WCC->UrlFragment2 == NULL)
                                                WCC->UrlFragment2 = NewStrBuf();
+                                       if (WCC->UrlFragment3 == NULL)
+                                               WCC->UrlFragment3 = NewStrBuf();
                                        StrBufPrintf(WCC->UrlFragment1, "%s", index[0]);
                                        StrBufPrintf(WCC->UrlFragment2, "%s", index[1]);
+                                       StrBufPrintf(WCC->UrlFragment3, "%s", index[2]);
                                }
                                if ((Handler->Flags & AJAX) != 0)
                                        begin_ajax_response();
@@ -1864,6 +1867,8 @@ void diagnostics(void)
        StrEscPuts(WC->UrlFragment1);
        wprintf("<br />\n");
        StrEscPuts(WC->UrlFragment2);
+       wprintf("<br />\n");
+       StrEscPuts(WC->UrlFragment3);
        wprintf("</PRE><hr />\n");
        wprintf("Variables: <br /><PRE>\n");
        dump_vars();
@@ -1872,26 +1877,26 @@ void diagnostics(void)
 }
 
 void view_mimepart(void) {
-       mimepart(ChrPtr(WC->UrlFragment1),
-                ChrPtr(WC->UrlFragment2),
+       mimepart(ChrPtr(WC->UrlFragment2),
+                ChrPtr(WC->UrlFragment3),
                 0);
 }
 
 void download_mimepart(void) {
-       mimepart(ChrPtr(WC->UrlFragment1),
-                ChrPtr(WC->UrlFragment2),
+       mimepart(ChrPtr(WC->UrlFragment2),
+                ChrPtr(WC->UrlFragment3),
                 1);
 }
 
 void view_postpart(void) {
-       postpart(WC->UrlFragment1,
-                WC->UrlFragment2,
+       postpart(WC->UrlFragment2,
+                WC->UrlFragment3,
                 0);
 }
 
 void download_postpart(void) {
-       postpart(WC->UrlFragment1,
-                WC->UrlFragment2,
+       postpart(WC->UrlFragment2,
+                WC->UrlFragment3,
                 1);
 }
 
@@ -1956,8 +1961,10 @@ void tmplput_url_part(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *
        if (WCC != NULL) {
                if (Tokens->Params[0]->lvalue == 0)
                        UrlBuf = WCC->UrlFragment1;
-               else
+               else if (Tokens->Params[0]->lvalue == 1)
                        UrlBuf = WCC->UrlFragment2;
+               else
+                       UrlBuf = WCC->UrlFragment3;
 
                StrBufAppendTemplate(Target, nArgs, Tokens, Context, ContextType,
                                     UrlBuf, 1);
index 371aac8dadc48a3dd1dc616ab11e0f376d84b7c0..a2eb57c92ccf71aef51bb59f02432d89ea28aea2 100644 (file)
@@ -617,6 +617,7 @@ struct wcsession {
        int time_format_cache;                  /**< which timeformat does our user like? */
        StrBuf *UrlFragment1;                   /**< first urlfragment, if NEED_URL is specified by the handler*/
        StrBuf *UrlFragment2;                   /**< second urlfragment, if NEED_URL is specified by the handler*/
+       StrBuf *UrlFragment3;                   /**< third urlfragment, if NEED_URL is specified by the handler*/
        StrBuf *WBuf;                           /**< Our output buffer */
        StrBuf *HBuf;                           /**< Our HeaderBuffer */
        StrBuf *CLineBuf;                       /**< linebuffering client stuff */