X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fnotes.c;h=079bb960b687d7b49e463e3bd5a2138841e4805c;hb=HEAD;hp=df39e36a3e3c777b11f285a4cd0b924eb96a4714;hpb=5d38a76f8f06640e3a3f097d584ac52336110f7c;p=citadel.git diff --git a/webcit/notes.c b/webcit/notes.c index df39e36a3..60c4d83a1 100644 --- a/webcit/notes.c +++ b/webcit/notes.c @@ -1,7 +1,7 @@ #include "webcit.h" #include "dav.h" -#include "webserver.h" + CtxType CTX_VNOTE = CTX_NONE; @@ -78,11 +78,11 @@ struct vnote *vnote_new_from_msg(long msgnum,int unread) if (!IsEmptyStr(bptr)) { if (!strncasecmp(bptr, "Content-type: ", 14)) { safestrncpy(msg4_content_type, &bptr[14], sizeof msg4_content_type); - striplt(msg4_content_type); + string_trim(msg4_content_type); } else if (!strncasecmp(bptr, "Content-transfer-encoding: ", 27)) { safestrncpy(msg4_content_encoding, &bptr[27], sizeof msg4_content_encoding); - striplt(msg4_content_type); + string_trim(msg4_content_type); } else if ((!strncasecmp(bptr, "Content-length: ", 16))) { msg4_content_length = atoi(&bptr[16]); @@ -435,8 +435,10 @@ int notes_Cleanup(void **ViewSpecific) return 0; } -void render_MIME_VNote(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset) +void render_MIME_VNote(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset) { + wc_mime_attachment *Mime = CTX(CTX_MIME_ATACH); + if (StrLength(Mime->Data) == 0) MimeLoadData(Mime); if (StrLength(Mime->Data) > 0) { @@ -485,7 +487,8 @@ InitModule_NOTES NULL, notes_LoadMsgFromServer, NULL, - notes_Cleanup); + notes_Cleanup, + NULL); WebcitAddUrlHandler(HKEY("add_new_note"), "", 0, add_new_note, 0); WebcitAddUrlHandler(HKEY("ajax_update_note"), "", 0, ajax_update_note, 0);