(fix) small fix for task reminders

This commit is contained in:
Ludovic Marcotte
2018-03-19 09:46:04 -04:00
parent 982cbed7cc
commit dff85ae1d7
2 changed files with 17 additions and 5 deletions
+15 -3
View File
@@ -102,10 +102,22 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
if ([self hasAlarms])
{
iCalAlarm *alarm;
NSString *webstatus;
alarm = [self firstDisplayOrAudioAlarm];
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 1];
[s appendString: [alarm activeSyncRepresentationInContext: context]];
if ((alarm = [self firstSupportedAlarm]))
{
webstatus = [[alarm trigger] value: 0 ofAttribute: @"x-webstatus"];
if (!webstatus || ([webstatus caseInsensitiveCompare: @"TRIGGERED"] != NSOrderedSame))
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 1];
else
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 0];
[s appendString: [alarm activeSyncRepresentationInContext: context]];
}
else
{
[s appendFormat: @"<ReminderSet xmlns=\"Tasks:\">%d</ReminderSet>", 0];
}
}
else
{