CheckConvertBufs(WCC);
FreeStrBuf(&Msg->reply_inreplyto);
Msg->reply_inreplyto = NewStrBufPlain(NULL, StrLength(HdrLine));
+ Msg->reply_inreplyto_hash = ThreadIdHash(HdrLine);
StrBuf_RFC822_2_Utf8(Msg->reply_inreplyto,
HdrLine,
WCC->DefaultCharset,
CheckConvertBufs(WCC);
FreeStrBuf(&Msg->reply_references);
Msg->reply_references = NewStrBufPlain(NULL, StrLength(HdrLine));
+ Msg->reply_references_hash = ThreadIdHash(HdrLine);
StrBuf_RFC822_2_Utf8(Msg->reply_references,
HdrLine,
WCC->DefaultCharset,
Mime->Data = NewStrBufPlain(NULL, Mime->length);
else
FlushStrBuf(Mime->Data);
- read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime);
+ read_message(Mime->Data, HKEY("view_submessage"), Mime->msgnum, Mime->PartNum, &TemplateMime, TP);
/*
if ( (!IsEmptyStr(mime_submessages)) && (!section[0]) ) {
for (i=0; i<num_tokens(mime_submessages, '|'); ++i) {
*/
}
-void render_MIME_VCard(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
-{
- wc_mime_attachment *Mime = (wc_mime_attachment *) CTX(CTX_MIME_ATACH);
- wcsession *WCC = WC;
- if (StrLength(Mime->Data) == 0)
- MimeLoadData(Mime);
- if (StrLength(Mime->Data) > 0) {
- StrBuf *Buf;
- Buf = NewStrBuf();
- /** If it's my vCard I can edit it */
- if ( (!strcasecmp(ChrPtr(WCC->CurRoom.name), USERCONFIGROOM))
- || (!strcasecmp(&(ChrPtr(WCC->CurRoom.name)[11]), USERCONFIGROOM))
- || (WC->CurRoom.view == VIEW_ADDRESSBOOK)
- ) {
- StrBufAppendPrintf(Buf, "<a href=\"edit_vcard?msgnum=%ld?partnum=%s\">",
- Mime->msgnum, ChrPtr(Mime->PartNum));
- StrBufAppendPrintf(Buf, "[%s]</a>", _("edit"));
- }
-
- /* In all cases, display the full card */
- display_vcard(Buf, Mime, 0, 1, NULL, -1);
- FreeStrBuf(&Mime->Data);
- Mime->Data = Buf;
- }
-
-}
-
void render_MIME_ICS(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
{
wc_mime_attachment *Mime = (wc_mime_attachment *) CTX(CTX_MIME_ATACH);
}
-message_summary *ReadOneMessageSummary(StrBuf *RawMessage, const char *DefaultSubject, StrBuf *FoundCharset, long MsgNum)
+int ReadOneMessageSummary(message_summary *Msg, StrBuf *FoundCharset, StrBuf *Buf)
{
void *vHdr;
headereval *Hdr;
- message_summary *Msg;
- StrBuf *Buf;
const char *buf;
const char *ebuf;
int nBuf;
long len;
- Buf = NewStrBuf();
-
- serv_printf("MSG0 %ld|1", MsgNum); /* ask for headers only */
+ serv_printf("MSG0 %ld|1", Msg->msgnum); /* ask for headers only */
StrBuf_ServGetln(Buf);
- if (GetServerStatus(Buf, NULL) == 1) {
- FreeStrBuf(&Buf);
- return NULL;
+ if (GetServerStatus(Buf, NULL) != 1) {
+ return 0;
}
- Msg = (message_summary*)malloc(sizeof(message_summary));
- memset(Msg, 0, sizeof(message_summary));
while (len = StrBuf_ServGetln(Buf),
(len >= 0) &&
((len != 3) ||
}
else syslog(LOG_INFO, "Don't know how to handle Message Headerline [%s]", ChrPtr(Buf));
}
- return Msg;
+ return 1;
}
void tmplput_MAIL_SUMM_N(StrBuf *Target, WCTemplputParams *TP)
void tmplput_MAIL_SUMM_PERMALINK(StrBuf *Target, WCTemplputParams *TP)
{
message_summary *Msg = (message_summary*) CTX(CTX_MAILSUM);
- char perma_link[1024];
-
- strcpy(perma_link, "/readfwd?go=");
- urlesc(&perma_link[12], sizeof(perma_link) - 12, (char *)ChrPtr(WC->CurRoom.name) );
- sprintf(&perma_link[strlen(perma_link)], "?start_reading_at=%ld#%ld", Msg->msgnum, Msg->msgnum);
- StrBufAppendPrintf(Target, "%s", perma_link);
+ StrBuf *perma_link;
+ const StrBuf *View;
+
+ perma_link = NewStrBufPlain(HKEY("/readfwd?go="));
+ StrBufUrlescAppend(perma_link, WC->CurRoom.name, NULL);
+ View = sbstr("view");
+ if (View != NULL) {
+ StrBufAppendBufPlain(perma_link, HKEY("?view="), 0);
+ StrBufAppendBuf(perma_link, View, 0);
+ }
+ StrBufAppendBufPlain(perma_link, HKEY("?start_reading_at="), 0);
+ StrBufAppendPrintf(perma_link, "%ld#%ld", Msg->msgnum, Msg->msgnum);
+ StrBufAppendBuf(Target, perma_link, 0);
+ FreeStrBuf(&perma_link);
}
MsgNum = LBstr(TKEY(0));
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_replyquote"), MsgNum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_replyquote"), MsgNum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
MsgNum = LBstr(TKEY(0));
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_edit"), MsgNum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_edit"), MsgNum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
free(wikipage);
if (msgnum >= 0L) {
Buf = NewStrBuf();
- read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime);
+ read_message(Buf, HKEY("view_message_wikiedit"), msgnum, NULL, &Mime, TP);
StrBufAppendTemplate(Target, TP, Buf, 1);
FreeStrBuf(&Buf);
}
FreeStrBuf(&Mime->Data);
Mime->Data = NewStrBufPlain(md_as_html, -1);
}
-// free(md_as_html);
mkd_cleanup(doc);
}
}
/* mime renderers translate an attachment into webcit viewable html text */
RegisterMimeRenderer(HKEY("message/rfc822"), render_MAIL, 0, 150);
- RegisterMimeRenderer(HKEY("text/x-vcard"), render_MIME_VCard, 1, 201);
- RegisterMimeRenderer(HKEY("text/vcard"), render_MIME_VCard, 1, 200);
//*
RegisterMimeRenderer(HKEY("text/calendar"), render_MIME_ICS, 1, 501);
RegisterMimeRenderer(HKEY("application/ics"), render_MIME_ICS, 1, 500);