X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fcalendar_tools.c;h=85c348ce00f9e6381303f0f002220640267102f0;hb=fe85bb758793dc0517d4b06fd09e0391d631c727;hp=9426716b355a21eb21bb8e74f8947c9d775a8703;hpb=3cb8c7f3cbda01a73e0e42d525cff197b7dcee34;p=citadel.git diff --git a/webcit/calendar_tools.c b/webcit/calendar_tools.c index 9426716b3..85c348ce0 100644 --- a/webcit/calendar_tools.c +++ b/webcit/calendar_tools.c @@ -178,5 +178,45 @@ void generate_new_uid(char *buf) { serv_info.serv_fqdn); } +/* + * Render a PARTSTAT parameter as a string (and put it in parentheses) + */ +void partstat_as_string(char *buf, icalproperty *attendee) { + icalparameter *partstat_param; + icalparameter_partstat partstat; + + strcpy(buf, "(status unknown)"); + + partstat_param = icalproperty_get_first_parameter( + attendee, + ICAL_PARTSTAT_PARAMETER + ); + if (partstat_param == NULL) { + return; + } + + partstat = icalparameter_get_partstat(partstat_param); + switch(partstat) { + case ICAL_PARTSTAT_X: + strcpy(buf, "(x)"); + case ICAL_PARTSTAT_NEEDSACTION: + strcpy(buf, "(needs action)"); + case ICAL_PARTSTAT_ACCEPTED: + strcpy(buf, "(accepted)"); + case ICAL_PARTSTAT_DECLINED: + strcpy(buf, "(declined)"); + case ICAL_PARTSTAT_TENTATIVE: + strcpy(buf, "(tenative)"); + case ICAL_PARTSTAT_DELEGATED: + strcpy(buf, "(delegated)"); + case ICAL_PARTSTAT_COMPLETED: + strcpy(buf, "(completed)"); + case ICAL_PARTSTAT_INPROCESS: + strcpy(buf, "(in process)"); + case ICAL_PARTSTAT_NONE: + strcpy(buf, "(none)"); + } +} + #endif