Began fixing http://uncensored.citadel.org/wiki?page=stefan2012mar07?go=exterminate
authorArt Cancro <ajc@uncensored.citadel.org>
Mon, 23 Apr 2012 18:06:34 +0000 (14:06 -0400)
committerArt Cancro <ajc@uncensored.citadel.org>
Mon, 23 Apr 2012 18:06:34 +0000 (14:06 -0400)
webcit/messages.c
webcit/msg_renderers.c
webcit/webcit.h
webcit/wiki.c

index 0c4786c87c8760850e2c86f96616d04baabcad07..f990c8700b09d1e358e502181194cccc5ec5c045 100644 (file)
@@ -5,17 +5,11 @@
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
- * 
- * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * 
- * 
- * 
  */
 
 #include "webcit.h"
  */
 
 #include "webcit.h"
@@ -1017,7 +1011,7 @@ void post_message(void)
                StrBuf *Recp = NULL; 
                StrBuf *Cc = NULL;
                StrBuf *Bcc = NULL;
                StrBuf *Recp = NULL; 
                StrBuf *Cc = NULL;
                StrBuf *Bcc = NULL;
-               const StrBuf *Wikipage = NULL;
+               char *wikipage = NULL;
                const StrBuf *my_email_addr = NULL;
                StrBuf *CmdBuf = NULL;
                StrBuf *references = NULL;
                const StrBuf *my_email_addr = NULL;
                StrBuf *CmdBuf = NULL;
                StrBuf *references = NULL;
@@ -1072,14 +1066,15 @@ void post_message(void)
                FreeStrBuf(&EmailAddress);
                FreeStrBuf(&EncBuf);
 
                FreeStrBuf(&EmailAddress);
                FreeStrBuf(&EncBuf);
 
-               Wikipage = sbstr("page");
+               wikipage = strdup(bstr("page"));
+               str_wiki_index(wikipage);
                my_email_addr = sbstr("my_email_addr");
                
                HeaderLen = StrLength(Recp) + 
                        StrLength(encoded_subject) +
                        StrLength(Cc) +
                        StrLength(Bcc) + 
                my_email_addr = sbstr("my_email_addr");
                
                HeaderLen = StrLength(Recp) + 
                        StrLength(encoded_subject) +
                        StrLength(Cc) +
                        StrLength(Bcc) + 
-                       StrLength(Wikipage) +
+                       strlen(wikipage) +
                        StrLength(my_email_addr) + 
                        StrLength(references);
                CmdBuf = NewStrBufPlain(NULL, sizeof (CMD) + HeaderLen);
                        StrLength(my_email_addr) + 
                        StrLength(references);
                CmdBuf = NewStrBufPlain(NULL, sizeof (CMD) + HeaderLen);
@@ -1091,11 +1086,12 @@ void post_message(void)
                             ChrPtr(display_name),
                             saving_to_drafts?"":ChrPtr(Cc),
                             saving_to_drafts?"":ChrPtr(Bcc),
                             ChrPtr(display_name),
                             saving_to_drafts?"":ChrPtr(Cc),
                             saving_to_drafts?"":ChrPtr(Bcc),
-                            ChrPtr(Wikipage),
+                            wikipage,
                             ChrPtr(my_email_addr),
                             ChrPtr(references));
                FreeStrBuf(&references);
                FreeStrBuf(&encoded_subject);
                             ChrPtr(my_email_addr),
                             ChrPtr(references));
                FreeStrBuf(&references);
                FreeStrBuf(&encoded_subject);
+               free(wikipage);
 
                if ((HeaderLen + StrLength(sbstr("msgtext")) < 10) && 
                    (GetCount(WCC->attachments) == 0)){
 
                if ((HeaderLen + StrLength(sbstr("msgtext")) < 10) && 
                    (GetCount(WCC->attachments) == 0)){
@@ -1579,14 +1575,15 @@ void display_enter(void)
                const StrBuf *Recp = NULL; 
                const StrBuf *Cc = NULL;
                const StrBuf *Bcc = NULL;
                const StrBuf *Recp = NULL; 
                const StrBuf *Cc = NULL;
                const StrBuf *Bcc = NULL;
-               const StrBuf *Wikipage = NULL;
+               char *wikipage = NULL;
                StrBuf *CmdBuf = NULL;
                const char CMD[] = "ENT0 0|%s|%d|0||%s||%s|%s|%s";
                
                Recp = sbstr("recp");
                Cc = sbstr("cc");
                Bcc = sbstr("bcc");
                StrBuf *CmdBuf = NULL;
                const char CMD[] = "ENT0 0|%s|%d|0||%s||%s|%s|%s";
                
                Recp = sbstr("recp");
                Cc = sbstr("cc");
                Bcc = sbstr("bcc");
-               Wikipage = sbstr("page");
+               wikipage = strdup(bstr("page"));
+               str_wiki_index(wikipage);
                
                CmdBuf = NewStrBufPlain(NULL, 
                                        sizeof (CMD) + 
                
                CmdBuf = NewStrBufPlain(NULL, 
                                        sizeof (CMD) + 
@@ -1594,7 +1591,7 @@ void display_enter(void)
                                        StrLength(display_name) +
                                        StrLength(Cc) +
                                        StrLength(Bcc) + 
                                        StrLength(display_name) +
                                        StrLength(Cc) +
                                        StrLength(Bcc) + 
-                                       StrLength(Wikipage));
+                                       strlen(wikipage));
 
                StrBufPrintf(CmdBuf, 
                             CMD,
 
                StrBufPrintf(CmdBuf, 
                             CMD,
@@ -1603,9 +1600,11 @@ void display_enter(void)
                             ChrPtr(display_name),
                             ChrPtr(Cc), 
                             ChrPtr(Bcc), 
                             ChrPtr(display_name),
                             ChrPtr(Cc), 
                             ChrPtr(Bcc), 
-                            ChrPtr(Wikipage));
+                            wikipage
+               );
                serv_puts(ChrPtr(CmdBuf));
                StrBuf_ServGetln(CmdBuf);
                serv_puts(ChrPtr(CmdBuf));
                StrBuf_ServGetln(CmdBuf);
+               free(wikipage);
 
                rc = GetServerStatusMsg(CmdBuf, &Result, 0, 0);
 
 
                rc = GetServerStatusMsg(CmdBuf, &Result, 0, 0);
 
index c00817739d823cdfe80f65b266271fc0dc596db1..d2de1f4bdf89313408ce64e2eff38ed9169b9876 100644 (file)
@@ -938,7 +938,10 @@ void tmplput_EDIT_WIKI_BODY(StrBuf *Target, WCTemplputParams *TP)
         * to do it again.
         */
        if (!havebstr("attach_button")) {
         * to do it again.
         */
        if (!havebstr("attach_button")) {
-               msgnum = locate_message_by_uid(BSTR("page"));
+               char *wikipage = strdup(bstr("page"));
+               str_wiki_index(wikipage);
+               msgnum = locate_message_by_uid(wikipage);
+               free(wikipage);
                if (msgnum >= 0L) {
                        Buf = NewStrBuf();
                        read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime);
                if (msgnum >= 0L) {
                        Buf = NewStrBuf();
                        read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime);
index 3d5b861164fe1a36ec0d8b46bf5048f2c36e1fc2..fd64a229cdffe670b6318e28d9ec22b0c8697184 100644 (file)
@@ -756,6 +756,8 @@ void end_tab(int tabnum, int num_tabs);
 
 int get_time_format_cached (void);
 void display_wiki_pagelist(void);
 
 int get_time_format_cached (void);
 void display_wiki_pagelist(void);
+void str_wiki_index(char *);
+
 HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP);
 
 /* actual supported locales */
 HashList *GetRoomListHashLKRA(StrBuf *Target, WCTemplputParams *TP);
 
 /* actual supported locales */
index 4f14137904ca34dd02172e3bf58535876b946c5e..c1ba90512e81491293a25063ed3daed1c501b48e 100644 (file)
@@ -5,17 +5,11 @@
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
  *
  * This program is open source software.  You can redistribute it and/or
  * modify it under the terms of the GNU General Public License, version 3.
- * 
- * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- *
- * 
- * 
- * 
  */
 
 #include "webcit.h"
  */
 
 #include "webcit.h"
@@ -129,6 +123,7 @@ void display_wiki_page(void)
        output_headers(1, 1, 1, 0, 0, 0);
        roomname = sbstr("room");
        safestrncpy(pagename, bstr("page"), sizeof pagename);
        output_headers(1, 1, 1, 0, 0, 0);
        roomname = sbstr("room");
        safestrncpy(pagename, bstr("page"), sizeof pagename);
+       str_wiki_index(pagename);
        safestrncpy(rev, bstr("rev"), sizeof rev);
        do_revert = atoi(bstr("revert"));
        display_wiki_page_backend(roomname, pagename, rev, do_revert);
        safestrncpy(rev, bstr("rev"), sizeof rev);
        do_revert = atoi(bstr("revert"));
        display_wiki_page_backend(roomname, pagename, rev, do_revert);