X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmessages.c;h=db7638b51a254bf399b463e6def3ee8809a7685b;hb=c73091a2ae896b6be5aa94b911c1c89d76a85688;hp=ac29cd5d7c4ec47015e9956527cedbea031c080b;hpb=4d0a622d2d3ae20770258981c6062f58c9fc01a3;p=citadel.git diff --git a/webcit/messages.c b/webcit/messages.c index ac29cd5d7..db7638b51 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1,7 +1,7 @@ /* * Functions which deal with the fetching and displaying of messages. * - * Copyright (c) 1996-2012 by the citadel.org team + * Copyright (c) 1996-2018 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, version 3. @@ -932,22 +932,12 @@ void post_mime_to_server(void) { serv_printf("\n--%s", alt_boundary); } - if (havebstr("markdown")) - { - serv_puts("Content-type: text/x-markdown; charset=utf-8"); - serv_puts("Content-Transfer-Encoding: quoted-printable"); - serv_puts(""); - text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */ - } - else - { - serv_puts("Content-type: text/html; charset=utf-8"); - serv_puts("Content-Transfer-Encoding: quoted-printable"); - serv_puts(""); - serv_puts("\r\n"); - text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */ - serv_puts("\r\n"); - } + serv_puts("Content-type: text/html; charset=utf-8"); + serv_puts("Content-Transfer-Encoding: quoted-printable"); + serv_puts(""); + serv_puts("\r\n"); + text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */ + serv_puts("\r\n"); if (include_text_alt) { serv_printf("--%s--", alt_boundary); @@ -1035,7 +1025,7 @@ void post_message(void) StrBuf *Recp = NULL; StrBuf *Cc = NULL; StrBuf *Bcc = NULL; - char *wikipage = NULL; + StrBuf *wikipage = NULL; const StrBuf *my_email_addr = NULL; StrBuf *CmdBuf = NULL; StrBuf *references = NULL; @@ -1090,7 +1080,7 @@ void post_message(void) FreeStrBuf(&EmailAddress); FreeStrBuf(&EncBuf); - wikipage = strdup(bstr("page")); + wikipage = NewStrBufDup(sbstr("page")); str_wiki_index(wikipage); my_email_addr = sbstr("my_email_addr"); @@ -1098,7 +1088,7 @@ void post_message(void) StrLength(encoded_subject) + StrLength(Cc) + StrLength(Bcc) + - strlen(wikipage) + + StrLength(wikipage) + StrLength(my_email_addr) + StrLength(references); CmdBuf = NewStrBufPlain(NULL, sizeof (CMD) + HeaderLen); @@ -1110,7 +1100,7 @@ void post_message(void) ChrPtr(display_name), saving_to_drafts?"":ChrPtr(Cc), saving_to_drafts?"":ChrPtr(Bcc), - wikipage, + ChrPtr(wikipage), ChrPtr(my_email_addr), ChrPtr(references)); FreeStrBuf(&references); @@ -1364,10 +1354,6 @@ void display_enter(void) int i = 0; long replying_to; - int prefer_md; - - get_pref_yesno("markdown", &prefer_md, 0); - if (havebstr("force_room")) { gotoroom(sbstr("force_room")); } @@ -1666,14 +1652,14 @@ void display_enter(void) const StrBuf *Recp = NULL; const StrBuf *Cc = NULL; const StrBuf *Bcc = NULL; - char *wikipage = NULL; + StrBuf *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 = strdup(bstr("page")); + wikipage = NewStrBufDup(sbstr("page")); str_wiki_index(wikipage); CmdBuf = NewStrBufPlain(NULL, @@ -1682,7 +1668,7 @@ void display_enter(void) StrLength(display_name) + StrLength(Cc) + StrLength(Bcc) + - strlen(wikipage)); + StrLength(wikipage)); StrBufPrintf(CmdBuf, CMD, @@ -1691,7 +1677,7 @@ void display_enter(void) ChrPtr(display_name), ChrPtr(Cc), ChrPtr(Bcc), - wikipage + ChrPtr(wikipage) ); serv_puts(ChrPtr(CmdBuf)); StrBuf_ServGetln(CmdBuf); @@ -1720,10 +1706,7 @@ void display_enter(void) begin_burst(); output_headers(1, 0, 0, 0, 1, 0); - if ((WCC->CurRoom.defview == VIEW_WIKIMD) || prefer_md) - DoTemplate(HKEY("edit_markdown_epic"), NULL, &NoCtx); - else - DoTemplate(HKEY("edit_message"), NULL, &NoCtx); + DoTemplate(HKEY("edit_message"), NULL, &NoCtx); end_burst(); return; @@ -2116,8 +2099,6 @@ InitModule_MSG PRF_STRING, NULL); RegisterPreference("mailbox",_("Mailbox view mode"), PRF_STRING, NULL); - RegisterPreference("markdown",_("Prefer markdown editing"), PRF_YESNO, NULL); - WebcitAddUrlHandler(HKEY("readnew"), "", 0, h_readnew, ANONYMOUS|NEED_URL); WebcitAddUrlHandler(HKEY("readold"), "", 0, h_readold, ANONYMOUS|NEED_URL);