See ChangeLog

Monotone-Parent: ff995ad9fc0f2d8dac7a71ba3e29531b2f45dfa2
Monotone-Revision: 193c17735fe473ec69d1c4ef59dcdce44a461da8

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2011-03-04T14:14:12
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Ludovic Marcotte 2011-03-04 14:14:12 +00:00
parent dba1d8a9a9
commit 80bd276899
3 changed files with 22 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2011-03-04 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.h/m:
-importCalendar: we now also import the timezone definition
when present
2011-02-25 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMailContext.[hm]: renamed from

View File

@ -158,7 +158,9 @@ typedef enum {
- (BOOL) includeInFreeBusy;
- (void) setIncludeInFreeBusy: (BOOL) newInclude;
- (BOOL) importComponent: (iCalEntityObject *) event;
- (BOOL) importComponent: (iCalEntityObject *) event
timezone: (NSString *) timezone;
- (int) importCalendar: (iCalCalendar *) calendar;
/* caldav proxy */

View File

@ -2577,6 +2577,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
}
- (BOOL) importComponent: (iCalEntityObject *) event
timezone: (NSString *) timezone
{
SOGoAppointmentObject *object;
NSString *uid;
@ -2588,14 +2589,16 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
inContainer: self];
[object setIsNew: YES];
content =
[NSString stringWithFormat: @"BEGIN:VCALENDAR\n%@\nEND:VCALENDAR",
[event versitString]];
[NSString stringWithFormat: @"BEGIN:VCALENDAR\n%@%@\nEND:VCALENDAR",
timezone, [event versitString]];
return ([object saveContentString: content] == nil);
}
- (int) importCalendar: (iCalCalendar *) calendar
{
NSMutableArray *components;
NSString *tz;
int imported, count, i;
imported = 0;
@ -2608,9 +2611,16 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
[components addObjectsFromArray: [calendar journals]];
[components addObjectsFromArray: [calendar freeBusys]];
#warning FIXME we might want to eventually support multiple timezone definitions and match the one used by the event
if ([[calendar timezones] count])
tz = [NSString stringWithFormat: @"%@\n",
[[[calendar timezones] lastObject] versitString]];
else
tz = @"";
count = [components count];
for (i = 0; i < count; i++)
if ([self importComponent: [components objectAtIndex: i]])
if ([self importComponent: [components objectAtIndex: i] timezone: tz])
imported++;
}