Skip to content

Commit c55e61e

Browse files
committed
oxcical: better error string for event instance group without RRULE
In a VEVENT group (one with the same UID) for a recurrence, there must be one main event with an RRULE line, and the subordinates with RECURRENCE-ID lines. If there is no VEVENT with RRULE, the calendar file is broken and eml2mt rejects it. The messsage was just the generic: ``` $ eml2mt --ical t.ics >/dev/zero t.ics: Import rejected for an unspecified reason (usually a too-strict parser). ``` Now this case outputs: ``` E-2739: Some VEVENT.RECURRENCE-ID points to a UID but there was no RRULE line anywhere ``` References: GXL-598, DESK-3426
1 parent a264470 commit c55e61e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/mapi/oxcical.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,9 @@ static bool oxcical_parse_valarm(uint32_t reminder_delta, time_t start_time,
19551955
static const ical_component *oxcical_main_event(const event_list_t &evlist, const char **err)
19561956
{
19571957
*err = nullptr;
1958-
if (evlist.size() == 1)
1958+
if (evlist.size() == 0)
1959+
return nullptr;
1960+
else if (evlist.size() == 1)
19591961
return evlist.front();
19601962
const ical_component *main_event = nullptr;
19611963
for (const auto &event : evlist) {
@@ -1979,6 +1981,8 @@ static const ical_component *oxcical_main_event(const event_list_t &evlist, cons
19791981
return nullptr;
19801982
}
19811983
}
1984+
if (main_event == nullptr)
1985+
*err = "E-2739: Some VEVENT.RECURRENCE-ID points to a UID but there was no RRULE line anywhere";
19821986
return main_event;
19831987
}
19841988

0 commit comments

Comments
 (0)