/*
* Functions which deal with the fetching and displaying of messages.
*
- * Copyright (c) 1996-2011 by the citadel.org team
+ * Copyright (c) 1996-2012 by the citadel.org team
*
* This program is open source software. You can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 3 of the
- * License, or (at your option) any later version.
+ * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "webcit.h"
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;
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);
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)){
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) +
StrLength(display_name) +
StrLength(Cc) +
StrLength(Bcc) +
- StrLength(Wikipage));
+ strlen(wikipage));
StrBufPrintf(CmdBuf,
CMD,
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);