From: Wilfried Göesgens Date: Tue, 11 Nov 2008 22:17:33 +0000 (+0000) Subject: * change syntax of read_message X-Git-Tag: v7.86~1797 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=8a38099b09f3080925ce7c4a62a016d6884f31bf * change syntax of read_message * hide wholist queries. * add citing/forwarding --- diff --git a/webcit/context_loop.c b/webcit/context_loop.c index 7b646fbd4..c2943f07e 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -454,7 +454,8 @@ void context_loop(int *sock) #ifdef TECH_PREVIEW if ((strncmp(ChrPtr(ReqLine), "/sslg", 5) != 0) && (strncmp(ChrPtr(ReqLine), "/static/", 8) != 0) && - (strncmp(ChrPtr(ReqLine), "/wholist_section", 16) != 0)) { + (strncmp(ChrPtr(ReqLine), "/wholist_section", 16) != 0) && + (strstr(ChrPtr(ReqLine), "wholist_section") == NULL)) { #endif lprintf(5, "HTTP: %s %s %s\n", ChrPtr(ReqType), ChrPtr(ReqLine), ChrPtr(HTTPVersion)); #ifdef TECH_PREVIEW diff --git a/webcit/messages.c b/webcit/messages.c index b67465d68..171373b4a 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -228,7 +228,7 @@ int summcmp_rdate(const void *s1, const void *s2) { * printable_view Nonzero to display a printable view * section Optional for encapsulated message/rfc822 submessage */ -void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const char *section) { +void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const StrBuf *section) { StrBuf *Buf; StrBuf *Token; StrBuf *FoundCharset; @@ -236,22 +236,15 @@ void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, i headereval *Hdr; void *vHdr; char buf[SIZ]; - struct attach_link *attach_links = NULL; - int num_attach_links = 0; // char mime_submessages[256] = ""; char reply_references[1024] = ""; - int i = 0; int Done = 0; int state=0; - char vcard_partnum[256] = ""; - char cal_partnum[256] = ""; - char *part_source = NULL; - char msg4_partnum[32] = ""; - -//// strcpy(mime_submessages, ""); + Buf = NewStrBuf(); - serv_printf("MSG4 %ld|%s", msgnum, section); + lprintf(1, "-------------------MSG4 %ld|%s--------------\n", msgnum, ChrPtr(section)); + serv_printf("MSG4 %ld|%s", msgnum, ChrPtr(section)); StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, NULL) != 1) { StrBufAppendPrintf(Target, ""); @@ -406,70 +399,6 @@ void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, i } DoTemplate(tmpl, tmpllen, Target, Msg, CTX_MAILSUM); - - -//// put message renderer lookup here. -///ENDBODY: /* If there are attached submessages, display them now... */ -/// -/// if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) { -/// for (i=0; i"); -/// read_message(msgnum, 1, buf); -/// wprintf(""); -/// } -/// } - - - /* Afterwards, offer links to download attachments 'n' such */ - if ( (num_attach_links > 0) && (!section[0]) ) { - for (i=0; iwc_roomname, USERCONFIGROOM)) - || (!strcasecmp(&WC->wc_roomname[11], USERCONFIGROOM)) - || (WC->wc_view == VIEW_ADDRESSBOOK) - ) { - wprintf("", - msgnum, vcard_partnum); - wprintf("[%s]", _("edit")); - } - - /* In all cases, display the full card */ - display_vcard(WC->WBuf, part_source, 0, 1, NULL,msgnum); - } - } - - /* Handler for calendar parts */ - if (!IsEmptyStr(cal_partnum)) { - } - - if (part_source) { - free(part_source); - part_source = NULL; - } - - wprintf("\n"); - - /* end everythingamundo table */ - if (!printable_view) { - wprintf("\n"); - } - - if (num_attach_links > 0) { - free(attach_links); - } DestroyMessageSummary(Msg); FreeStrBuf(&FoundCharset); FreeStrBuf(&Token); @@ -490,9 +419,9 @@ void embed_message(void) { msgnum = StrTol(WC->UrlFragment1); if (StrLength(Tmpl) > 0) - read_message(WC->WBuf, SKEY(Tmpl), msgnum, 0, ""); + read_message(WC->WBuf, SKEY(Tmpl), msgnum, 0, NULL); else - read_message(WC->WBuf, HKEY("view_message"), msgnum, 0, ""); + read_message(WC->WBuf, HKEY("view_message"), msgnum, 0, NULL); } @@ -513,7 +442,7 @@ void print_message(void) { begin_burst(); - read_message(WC->WBuf, HKEY("view_message_print"), msgnum, 1, ""); + read_message(WC->WBuf, HKEY("view_message_print"), msgnum, 1, NULL); wDumpContent(0); } @@ -529,7 +458,7 @@ void mobile_message_view(void) { output_headers(1, 0, 0, 0, 0, 1); begin_burst(); do_template("msgcontrols", NULL); - read_message(WC->WBuf, HKEY("view_message"), msgnum,1, ""); + read_message(WC->WBuf, HKEY("view_message"), msgnum,1, NULL); wDumpContent(0); } @@ -894,22 +823,6 @@ ENDBODY: -void EvaluateMimePart(message_summary *Sum, StrBuf *Buf) -{//// paert=; TODO -/* - extract_token(mime_filename, &buf[5], 1, '|', sizeof mime_filename); - extract_token(mime_partnum, &buf[5], 2, '|', sizeof mime_partnum); - extract_token(mime_disposition, &buf[5], 3, '|', sizeof mime_disposition); - extract_token(mime_content_type, &buf[5], 4, '|', sizeof mime_content_type); - mime_length = extract_int(&buf[5], 5); - - if ( (!strcasecmp(mime_content_type, "text/x-vcard")) - || (!strcasecmp(mime_content_type, "text/vcard")) ) { - strcpy(vcard_partnum, mime_partnum); - } -*/ -} - message_summary *ReadOneMessageSummary(StrBuf *RawMessage, const char *DefaultSubject, long MsgNum) { void *vEval; @@ -1610,7 +1523,7 @@ void readloop(char *oper) /** if we do a split bbview in the future, begin messages div here */ for (a=0; aWBuf, HKEY("view_message"), displayed_msgs[a], 0, ""); + read_message(WC->WBuf, HKEY("view_message"), displayed_msgs[a], 0, NULL); } /** if we do a split bbview in the future, end messages div here */ diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index ec3cf9632..cd3cd88ea 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -101,7 +101,6 @@ void tmplput_MAIL_SUMM_FROM(StrBuf *Target, int nArgs, WCTemplateToken *Token, v { message_summary *Msg = (message_summary*) Context; StrBufAppendBuf(Target, Msg->from, 0); - lprintf(1,"%s", ChrPtr(Msg->from)); } @@ -111,7 +110,6 @@ void examine_subj(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) FreeStrBuf(&Msg->subj); Msg->subj = NewStrBufPlain(NULL, StrLength(HdrLine)); StrBuf_RFC822_to_Utf8(Msg->subj, HdrLine, WC->DefaultCharset, FoundCharset); - lprintf(1,"%s", ChrPtr(Msg->subj)); } void tmplput_MAIL_SUMM_SUBJECT(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType) {/////TODO: Fwd: and RE: filter!! @@ -268,7 +266,7 @@ void tmplput_MAIL_SUMM_DATE_NO(StrBuf *Target, int nArgs, WCTemplateToken *Token void render_MAIL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset) { Mime->Data = NewStrBufPlain(NULL, Mime->length); - read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, ChrPtr(Mime->PartNum)); + read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, Mime->PartNum); /* if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) { for (i=0; iParams[0]->Start, Token->Params[0]->len); + read_message(Target, HKEY("view_message_replyquote"), MsgNum, 0, NULL); +} void tmplput_MAIL_BODY(StrBuf *Target, int nArgs, WCTemplateToken *Token, void *Context, int ContextType) { @@ -541,6 +544,12 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F iconv_t ic = (iconv_t)(-1) ; #endif + if ((StrLength(Mime->Data) == 0) && (Mime->length > 0)) { + FreeStrBuf(&Mime->Data); + Mime->Data = NewStrBufPlain(NULL, Mime->length); + read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, 0, Mime->PartNum); + } + /* Boring old 80-column fixed format text gets handled this way... */ if ((strcasecmp(ChrPtr(Mime->Charset), "us-ascii") == 0) && (strcasecmp(ChrPtr(Mime->Charset), "UTF-8") == 0)) @@ -779,7 +788,7 @@ InitModule_MSGRENDERERS RegisterNamespace("MAIL:SUMM:REFIDS", 0, 0, tmplput_MAIL_SUMM_REFIDS, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:INREPLYTO", 0, 2, tmplput_MAIL_SUMM_INREPLYTO, CTX_MAILSUM); RegisterNamespace("MAIL:BODY", 0, 2, tmplput_MAIL_BODY, CTX_MAILSUM); - + RegisterNamespace("MAIL:QUOTETEXT", 1, 2, tmplput_QUOTED_MAIL_BODY, CTX_NONE); RegisterNamespace("ATT:SIZE", 0, 1, tmplput_ATT_Length, CTX_ATT); RegisterNamespace("ATT:TYPE", 0, 1, tmplput_ATT_Contenttype, CTX_ATT); RegisterNamespace("ATT:FILENAME", 0, 1, tmplput_ATT_FileName, CTX_ATT); diff --git a/webcit/static/t/view_message.html b/webcit/static/t/view_message.html index 09a789568..6b01cc698 100644 --- a/webcit/static/t/view_message.html +++ b/webcit/static/t/view_message.html @@ -27,10 +27,11 @@ onMouseOut=document.getElementById("msg").style.visibility="hidden
+
- +
diff --git a/webcit/static/t/view_message_replyquote.html b/webcit/static/t/view_message_replyquote.html new file mode 100644 index 000000000..dc07d15d5 --- /dev/null +++ b/webcit/static/t/view_message_replyquote.html @@ -0,0 +1,15 @@ +
+
+ + + + *** + +

+
+ +
+ +
+ +
diff --git a/webcit/webcit.h b/webcit/webcit.h index 8074087b1..15b7318e5 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -783,7 +783,7 @@ void dump_vars(void); void embed_main_menu(void); void serv_read(char *buf, int bytes); void readloop(char *oper); -void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const char *section); +void read_message(StrBuf *Target, const char *tmpl, long tmpllen, long msgnum, int printable_view, const StrBuf *section); void do_addrbook_view(addrbookent *addrbook, int num_ab); void display_vcard(StrBuf *Target, const char *vcard_source, char alpha, int full, char *storename, long msgnum); void text_to_server(char *ptr); diff --git a/webcit/wiki.c b/webcit/wiki.c index 691efcf08..067ac6d38 100644 --- a/webcit/wiki.c +++ b/webcit/wiki.c @@ -77,7 +77,7 @@ void display_wiki_page(void) msgnum = locate_message_by_uid(pagename); if (msgnum >= 0L) { output_headers(1, 1, 1, 0, 0, 0); - read_message(WC->WBuf, HKEY("view_message"), msgnum, 0, ""); + read_message(WC->WBuf, HKEY("view_message"), msgnum, 0, NULL); wDumpContent(1); return; }