X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fical_subst.c;h=ffacf41f471a3016e5dd818b45d14cdbd24614c0;hb=97bdaff4147703998a868ed6d19232c4342acca4;hp=43a10f2eb503cbbb336425ec0d7b0de1b43fc7f5;hpb=6cc8e02c78fa3b6e46f447396cda18f190f3d0d1;p=citadel.git diff --git a/webcit/ical_subst.c b/webcit/ical_subst.c index 43a10f2eb..ffacf41f4 100644 --- a/webcit/ical_subst.c +++ b/webcit/ical_subst.c @@ -20,6 +20,7 @@ CtxType CTX_ICAL = CTX_NONE; CtxType CTX_ICALPROPERTY = CTX_NONE; CtxType CTX_ICALMETHOD = CTX_NONE; CtxType CTX_ICALTIME = CTX_NONE; +CtxType CTX_ICALATTENDEE = CTX_NONE; #if 0 void SortPregetMatter(HashList *Cals) { @@ -265,14 +266,16 @@ void tmplput_CtxICalPropertyDate(StrBuf *Target, WCTemplputParams *TP) -void render_MIME_ICS_TPL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *FoundCharset) +void render_MIME_ICS_TPL(StrBuf *Target, WCTemplputParams *TP, StrBuf *FoundCharset) { + wc_mime_attachment *Mime = CTX(CTX_MIME_ATACH); icalproperty_method the_method = ICAL_METHOD_NONE; icalproperty *method = NULL; icalcomponent *cal; icalcomponent *c; WCTemplputParams SubTP; WCTemplputParams SuperTP; + static int divcount = 0; if (StrLength(Mime->Data) == 0) { @@ -288,6 +291,8 @@ void render_MIME_ICS_TPL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *Foun } putlbstr("divname", ++divcount); + + putbstr("cal_partnum", NewStrBufDup(Mime->PartNum)); putlbstr("msgnum", Mime->msgnum); @@ -305,8 +310,12 @@ void render_MIME_ICS_TPL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *Foun the_method = icalproperty_get_method(method); } - SuperTP.Context = &the_method; - SuperTP.Filter.ContextType = CTX_ICALMETHOD, + StackContext (TP, + &SuperTP, + &the_method, + CTX_ICALMETHOD, + 0, + TP->Tokens); StackContext (&SuperTP, &SubTP, @@ -327,6 +336,7 @@ void render_MIME_ICS_TPL(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *Foun "EnableOrDisableCheckButton(); \n" ); + UnStackContext(&SuperTP); UnStackContext(&SubTP); icalcomponent_free(cal); } @@ -368,40 +378,65 @@ int cond_ICalIsMethod(StrBuf *Target, WCTemplputParams *TP) - - - - void tmplput_Conflict(StrBuf *Target, WCTemplputParams *TP) {} -HashList* IterateGetAttendees() + +HashList *iterate_get_ical_attendees(StrBuf *Target, WCTemplputParams *TP) { -/* - /* If the component has attendees, iterate through them. * / + icalcomponent *cal = (icalcomponent *) CTX(CTX_ICAL); + icalparameter *partstat_param; + icalproperty *p; + CalAttendee *Att; + HashList *Attendees = NULL; + const char *ch; + int n = 0; + + /* If the component has attendees, iterate through them. */ for (p = icalcomponent_get_first_property(cal, ICAL_ATTENDEE_PROPERTY); (p != NULL); p = icalcomponent_get_next_property(cal, ICAL_ATTENDEE_PROPERTY)) { - StrBufAppendPrintf(Target, "