Fix frequency detection of recurrence rule

This commit is contained in:
Francis Lachapelle
2016-02-04 09:20:11 -05:00
parent 7437ca1ab8
commit a8845d262f
2 changed files with 7 additions and 9 deletions
@@ -1,6 +1,6 @@
/* iCalRepeatableEntityObject+SOGo.m - this file is part of SOGo
*
* Copyright (C) 2007-2015 Inverse inc.
* Copyright (C) 2007-2016 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -164,12 +164,12 @@
rule = [iCalRecurrenceRule new];
[rule setInterval: @"1"];
frequency = (int) NSNotFound;
frequency = 0;
o = [repeat objectForKey: @"frequency"];
if ([o isKindOfClass: [NSString class]])
{
frequency = [rule valueForFrequency: o];
if ((int) frequency == NSNotFound)
if (!frequency)
{
if ([o caseInsensitiveCompare: @"BI-WEEKLY"] == NSOrderedSame)
{
@@ -223,7 +223,7 @@
[rule setValues: o atIndex: 0 forKey: @"bymonth"];
}
if ((int) frequency != NSNotFound)
if (frequency)
{
[rule setFrequency: frequency];
[self setRecurrenceRules: [NSArray arrayWithObject: rule]];