- if ((ch != NULL) && !strncasecmp(buf, "MAILTO:", 7)) {
-
- /** screen name or email address * /
- safestrncpy(buf, ch + 7, sizeof(buf));
- striplt(buf);
- StrEscAppend(Target, NULL, buf, 0, 0);
- StrBufAppendPrintf(Target, " ");
-
- /** participant status * /
- partstat_as_string(buf, p);
- StrEscAppend(Target, NULL, buf, 0, 0);
+ if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
+ Att = (CalAttendee*) malloc(sizeof(CalAttendee));
+
+ /** screen name or email address */
+ Att->AttendeeStr = NewStrBufPlain(ch + 7, -1);
+ StrBufTrim(Att->AttendeeStr);
+
+ /** participant status */
+ partstat_param = icalproperty_get_first_parameter(
+ p,
+ ICAL_PARTSTAT_PARAMETER
+ );
+ if (partstat_param == NULL) {
+ Att->partstat = ICAL_PARTSTAT_X;
+ }
+ else {
+ Att->partstat = icalparameter_get_partstat(partstat_param);
+ }
+ if (Attendees == NULL)
+ Attendees = NewHash(1, Flathash);
+ Put(Attendees, IKEY(n), Att, DeleteAtt);
+ n++;