Correctly loop among calendars. This fixes #2070.

This commit is contained in:
Ludovic Marcotte
2012-11-17 16:12:23 -05:00
parent 3f8d374d63
commit 8fd0966a23

View File

@@ -59,12 +59,14 @@
{
SOGoAppointmentFolder *folder;
NSMutableDictionary *rc;
WORequest *request;
WOResponse *response;
NSString *fileContent;
id data;
iCalCalendar *additions;
int imported;
NSString *fileContent;
WOResponse *response;
WORequest *request;
NSArray *cals;
id data;
int i, imported;
imported = 0;
rc = [NSMutableDictionary dictionary];
@@ -86,8 +88,13 @@
if (fileContent && [fileContent length]
&& [fileContent hasPrefix: @"BEGIN:"])
{
additions = [iCalCalendar parseSingleFromSource: fileContent];
imported = [folder importCalendar: additions];
cals = [iCalCalendar parseFromSource: fileContent];
for (i = 0; i < [cals count]; i++)
{
additions = [cals objectAtIndex: i];
imported += [folder importCalendar: additions];
}
}
[rc setObject: [NSNumber numberWithInt: imported]