/*
* 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.
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("<html><body>\r\n");
- text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */
- serv_puts("</body></html>\r\n");
- }
+ serv_puts("Content-type: text/html; charset=utf-8");
+ serv_puts("Content-Transfer-Encoding: quoted-printable");
+ serv_puts("");
+ serv_puts("<html><body>\r\n");
+ text_to_server_qp(sbstr("msgtext")); /* Transmit message in quoted-printable encoding */
+ serv_puts("</body></html>\r\n");
if (include_text_alt) {
serv_printf("--%s--", alt_boundary);
int i = 0;
long replying_to;
- int prefer_md;
-
- get_pref_yesno("markdown", &prefer_md, 0);
-
if (havebstr("force_room")) {
gotoroom(sbstr("force_room"));
}
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;
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);
Mime->Data = Buf;
}
-#ifdef HAVE_MARKDOWN
-/*
-char * MarkdownHandleURL(const char* SourceURL, const int len, void* something)
-{
-
-}
-*/
-void render_MAIL_markdown(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
-{
-#include <mkdio.h>
- wc_mime_attachment *Mime = (wc_mime_attachment *) CTX(CTX_MIME_ATACH);
- MMIOT *doc;
- char *md_as_html = NULL;
- const char *format;
-
- if (StrLength(Mime->Data) == 0)
- return;
-
- format = bstr("format");
-
- if ((format == NULL) ||
- strcmp(format, "plain"))
- {
- doc = mkd_string(ChrPtr(Mime->Data), StrLength(Mime->Data), 0);
- mkd_basename(doc, "/wiki?page=");
- mkd_compile(doc, 0);
- if (mkd_document(doc, &md_as_html) != EOF) {
- FreeStrBuf(&Mime->Data);
- Mime->Data = NewStrBufPlain(md_as_html, -1);
- }
- mkd_cleanup(doc);
- }
-}
-#endif
void render_MAIL_UNKNOWN(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
{
RegisterMimeRenderer(HKEY("text/plain"), render_MAIL_text_plain, 1, 3);
RegisterMimeRenderer(HKEY("text"), render_MAIL_text_plain, 1, 1);
RegisterMimeRenderer(HKEY("text/html"), render_MAIL_html, 1, 100);
-#ifdef HAVE_MARKDOWN
- RegisterMimeRenderer(HKEY("text/x-markdown"), render_MAIL_markdown, 1, 30);
-#endif
RegisterMimeRenderer(HKEY(""), render_MAIL_UNKNOWN, 0, 0);
/* these headers are citserver replies to MSG4 and friends. one evaluator for each */
}
void dotgoto(void) {
- wcsession *WCC = WC;
if (!havebstr("room")) {
readloop(readnew, eUseDefault);
return;
}
- if ((WCC->CurRoom.view != VIEW_MAILBOX) &&
- (WCC->CurRoom.view != WCC->CurRoom.view)) {
+ if (WC->CurRoom.view != VIEW_MAILBOX) {
/* dotgoto acts like dotskip when we're in a mailbox view */
slrp_highest();
}
0, /* VIEW_JOURNAL Journal */
0, /* VIEW_DRAFTS Drafts */
1, /* VIEW_BLOG Blog */
- 0, /* VIEW_QUEUE Mail Queue */
- 1 /* VIEW_WIKIMD MarkDown Wiki */
+ 0 /* VIEW_QUEUE Mail Queue */
};
/*
{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0 }, /* journal */
{ 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0 }, /* drafts */
{ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, /* blog */
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } /* Markdown wiki */
};
/*
viewdefs[VIEW_JOURNAL] = _("Journal");
viewdefs[VIEW_DRAFTS] = _("Drafts");
viewdefs[VIEW_BLOG] = _("Blog");
- viewdefs[VIEW_WIKIMD] = _("Markdown Wiki");
}
case VIEW_WIKI:
StrBufAppendBufPlain(Target, HKEY("wiki"), 0);
break;
- case VIEW_WIKIMD:
- StrBufAppendBufPlain(Target, HKEY("x-markdown"), 0);
- break;
}
}
+/*
+ * Functions which handle communication with the Citadel server.
+ *
+ * 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.
+ */
#include "webcit.h"
#include "webserver.h"
int d_namelen;
int istoplevel;
+ if (IsEmptyStr(DirName))
+ {
+ return 0;
+ }
+
filedir = opendir (DirName);
- if (filedir == NULL) {
+ if (filedir == NULL)
+ {
return 0;
}
d = (struct dirent *)malloc(offsetof(struct dirent, d_name) + PATH_MAX + 1);
- if (d == NULL) {
+ if (d == NULL)
+ {
closedir(filedir);
return 0;
}
WebcitAddUrlHandler(HKEY("static.local"), "", 0, output_static_1, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC|LOGCHATTY);
WebcitAddUrlHandler(HKEY("tinymce"), "", 0, output_static_2, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC|LOGCHATTY);
WebcitAddUrlHandler(HKEY("tiny_mce"), "", 0, output_static_2, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC|LOGCHATTY);
- WebcitAddUrlHandler(HKEY("markdown"), "", 0, output_static_3, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC|LOGCHATTY);
WebcitAddUrlHandler(HKEY("epiceditor"), "", 0, output_static_3, ANONYMOUS|COOKIEUNNEEDED|ISSTATIC|LOGCHATTY);
}
char file_etc_mimelist[PATH_MAX]="";
const char editor_absolut_dir[PATH_MAX]=EDITORDIR; /* nailed to what configure gives us. */
-const char markdown_editor_absolutedir[]=MARKDOWNEDITORDIR;
char etc_dir[PATH_MAX];
char static_dir[PATH_MAX]; /* calculated on startup */
(char*)static_dir, /* our templates on disk */
(char*)static_local_dir, /* user provided templates disk */
(char*)editor_absolut_dir, /* the editor on disk */
- (char*)static_icon_dir, /* our icons... */
- (char*)markdown_editor_absolutedir
+ (char*)static_icon_dir /* our icons... */
};
int ExitPipe[2];
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) == 1) {
Hash = NewHash(1, Flathash);
-
+ Done = 0;
while (!Done) {
len = StrBuf_ServGetln(Buf);
if ((len <0) ||
serv_puts("LBIO 1");
StrBuf_ServGetln(Buf);
- if (GetServerStatus(Buf, NULL) == 1)
+ if (GetServerStatus(Buf, NULL) == 1) {
Done = 0;
while (!Done) {
- len = StrBuf_ServGetln(Buf);
- if ((len <0) || ((len == 3) && !strcmp(ChrPtr(Buf), "000")))
- {
- Done = 1;
- break;
+ len = StrBuf_ServGetln(Buf);
+ if ((len <0) || ((len == 3) && !strcmp(ChrPtr(Buf), "000")))
+ {
+ Done = 1;
+ break;
+ }
}
UID = atoi(ChrPtr(Buf));
if (GetHash(Hash, IKEY(UID), &vData) && vData != 0)
* persistent session to the Citadel server, handling HTTP WebCit requests as
* they arrive and presenting a user interface.
*
- * Copyright (c) 1996-2013 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.