X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmsg_renderers.c;h=10e20e90d2f2bfda4cf5baf2be49bf54f83bc62e;hb=5dd116cf07d991263431624a735698374c6fb692;hp=ed58d93d519be015747afa000ddb3b2d4869334a;hpb=f6d71aae85cfa20ef1e806b18b1bea18ac44720e;p=citadel.git diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index ed58d93d5..10e20e90d 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -865,6 +865,21 @@ void tmplput_MAIL_SUMM_N(StrBuf *Target, WCTemplputParams *TP) } +void tmplput_MAIL_SUMM_PERMALINK(StrBuf *Target, WCTemplputParams *TP) +{ + message_summary *Msg = (message_summary*) CTX; + char perma_link[1024]; + char encoded_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); + + + CtdlEncodeBase64(encoded_link, perma_link, strlen(perma_link), 0); + StrBufAppendPrintf(Target, "/B64%s", encoded_link); +} + int Conditional_MAIL_MIME_ALL(StrBuf *Target, WCTemplputParams *TP) { @@ -1418,9 +1433,9 @@ InitModule_MSGRENDERERS RegisterReadLoopHandlerset( VIEW_MAILBOX, mailview_GetParamsGetServerCall, - NULL, /// TODO: is this right? + NULL, /* TODO: is this right? */ ParseMessageListHeaders_Detail, - NULL, //// "" + NULL, mailview_RenderView_or_Tail, mailview_Cleanup); @@ -1453,6 +1468,7 @@ InitModule_MSGRENDERERS RegisterNamespace("MAIL:SUMM:DATEFULL", 0, 0, tmplput_MAIL_SUMM_DATE_FULL, NULL, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:DATENO", 0, 0, tmplput_MAIL_SUMM_DATE_NO, NULL, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:N", 0, 0, tmplput_MAIL_SUMM_N, NULL, CTX_MAILSUM); + RegisterNamespace("MAIL:SUMM:PERMALINK", 0, 0, tmplput_MAIL_SUMM_PERMALINK, NULL, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:FROM", 0, 2, tmplput_MAIL_SUMM_FROM, NULL, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:TO", 0, 2, tmplput_MAIL_SUMM_TO, NULL, CTX_MAILSUM); RegisterNamespace("MAIL:SUMM:SUBJECT", 0, 4, tmplput_MAIL_SUMM_SUBJECT, NULL, CTX_MAILSUM);