X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fmessages.c;fp=webcit%2Fmessages.c;h=f990c8700b09d1e358e502181194cccc5ec5c045;hp=0c4786c87c8760850e2c86f96616d04baabcad07;hb=dca4414169da8ea7161d5b95fc9ccbefe5d39651;hpb=a9d212c452ddc4c041c6b1ca30670dde9a321a07 diff --git a/webcit/messages.c b/webcit/messages.c index 0c4786c87..f990c8700 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -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 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" @@ -1017,7 +1011,7 @@ void post_message(void) 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; @@ -1072,14 +1066,15 @@ void post_message(void) 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) + - StrLength(Wikipage) + + strlen(wikipage) + 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(Wikipage), + wikipage, ChrPtr(my_email_addr), ChrPtr(references)); FreeStrBuf(&references); FreeStrBuf(&encoded_subject); + free(wikipage); 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 *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"); - Wikipage = sbstr("page"); + wikipage = strdup(bstr("page")); + str_wiki_index(wikipage); CmdBuf = NewStrBufPlain(NULL, sizeof (CMD) + @@ -1594,7 +1591,7 @@ void display_enter(void) StrLength(display_name) + StrLength(Cc) + StrLength(Bcc) + - StrLength(Wikipage)); + strlen(wikipage)); StrBufPrintf(CmdBuf, CMD, @@ -1603,9 +1600,11 @@ void display_enter(void) ChrPtr(display_name), ChrPtr(Cc), ChrPtr(Bcc), - ChrPtr(Wikipage)); + wikipage + ); serv_puts(ChrPtr(CmdBuf)); StrBuf_ServGetln(CmdBuf); + free(wikipage); rc = GetServerStatusMsg(CmdBuf, &Result, 0, 0);