Initial support for multiple alarms and better iCal compatibility

This commit is contained in:
Ludovic Marcotte
2014-09-12 14:09:28 -04:00
parent 12a4fd05a2
commit b8b3519a40
7 changed files with 69 additions and 23 deletions
+6 -6
View File
@@ -534,16 +534,16 @@ iRANGE(2);
if ([component hasAlarms])
{
// We currently have the following limitations for alarms:
// - only the first alarm is considered;
// - the alarm's action must be of type DISPLAY;
// - the alarm's action must be of type DISPLAY or AUDIO (considered as DISPLAY)
// - the alarm's trigger value type must be DURATION.
anAlarm = [[component alarms] objectAtIndex: 0];
anAlarm = [component firstSupportedAlarm];
aTrigger = [anAlarm trigger];
ASSIGN (reminderAction, [[anAlarm action] lowercaseString]);
if (([reminderAction isEqualToString: @"display"]
|| [reminderAction isEqualToString: @"email"])
&& [[aTrigger valueType] caseInsensitiveCompare: @"DURATION"] == NSOrderedSame)
// The default value type is DURATION. See http://tools.ietf.org/html/rfc5545#section-3.8.6.3
if (![[aTrigger valueType] length] ||
[[aTrigger valueType] caseInsensitiveCompare: @"DURATION"] == NSOrderedSame)
{
duration = [aTrigger flattenedValuesForKey: @""];
i = [reminderValues indexOfObject: duration];