]> code.citadel.org Git - citadel.git/blobdiff - webcit/msg_renderers.c
Use strbuf in template token handler
[citadel.git] / webcit / msg_renderers.c
index 516041eab49b9fdc0df399dd3b9e1e39bc0bacaa..d68911edcec5adc16cc0cb6e675f47734f6f7566 100644 (file)
@@ -612,33 +612,6 @@ void render_MAIL(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset)
 */
 }
 
-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);
@@ -931,7 +904,7 @@ void tmplput_MAIL_SUMM_PERMALINK(StrBuf *Target, WCTemplputParams *TP)
 
        perma_link = NewStrBufPlain(HKEY("/readfwd?go="));
        StrBufUrlescAppend(perma_link, WC->CurRoom.name, NULL);
-       View = SBSTR("view");
+       View = sbstr("view");
        if (View != NULL) {
                StrBufAppendBufPlain(perma_link, HKEY("?view="), 0);
                StrBufAppendBuf(perma_link, View, 0);
@@ -1215,7 +1188,6 @@ void render_MAIL_markdown(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCha
                        FreeStrBuf(&Mime->Data);
                        Mime->Data = NewStrBufPlain(md_as_html, -1);
                }
-//     free(md_as_html);
                mkd_cleanup(doc);
        }
 }
@@ -1672,8 +1644,6 @@ InitModule_MSGRENDERERS
 
        /* 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);