mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-16 08:55:24 +00:00
Fixed ics subscription crash with store
Monotone-Parent: 151b30c115a62428b80f871f09930672bb0b764b Monotone-Revision: 11ca52315bdce5c8e4b000e5b9f33d5b2ecbd052 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-23T15:00:50 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
2009-09-23 Cyril Robert <crobert@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m (importComponent:): Fixed
|
||||
addition of BEGIN/END block.
|
||||
* SoObjects/Appointments/SOGoWebAppointmentFolder.m (deleteAllContent):
|
||||
Created deleteAllContent to be able to change it in the store bundle.
|
||||
* UI/Scheduler/UIxCalMainActions.m (addWebCalendarAction): Small improvement.
|
||||
|
||||
2009-09-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/SOGoAutoCompletion.js
|
||||
|
||||
@@ -3191,39 +3191,25 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||
object = [SOGoAppointmentObject objectWithName: uid
|
||||
inContainer: self];
|
||||
content =
|
||||
[NSString stringWithFormat: @"BEGIN:VCALENDAR\n%@END:VCALENDAR\n",
|
||||
[NSString stringWithFormat: @"BEGIN:VCALENDAR\n%@\nEND:VCALENDAR",
|
||||
[event versitString]];
|
||||
return ([object saveContentString: content] == nil);
|
||||
}
|
||||
|
||||
- (int) importCalendar: (iCalCalendar *) calendar
|
||||
{
|
||||
NSArray *components;
|
||||
NSMutableArray *components;
|
||||
int imported, count, i;
|
||||
|
||||
imported = 0;
|
||||
|
||||
if (calendar)
|
||||
{
|
||||
components = [calendar events];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([self importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
components = [[calendar events] mutableCopy];
|
||||
[components addObjectsFromArray: [calendar todos]];
|
||||
[components addObjectsFromArray: [calendar journals]];
|
||||
[components addObjectsFromArray: [calendar freeBusys]];
|
||||
|
||||
components = [calendar todos];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([self importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
|
||||
components = [calendar journals];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([self importComponent: [components objectAtIndex: i]])
|
||||
imported++;
|
||||
|
||||
components = [calendar freeBusys];
|
||||
count = [components count];
|
||||
for (i = 0; i < count; i++)
|
||||
if ([self importComponent: [components objectAtIndex: i]])
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
@interface SOGoAppointmentFolders : SOGoParentFolder
|
||||
|
||||
- (NSArray *) proxyFoldersWithWriteAccess: (BOOL) hasWriteAccess;
|
||||
- (NSArray *) webCalendarIds;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
@interface SOGoWebAppointmentFolder : SOGoAppointmentFolder
|
||||
|
||||
- (int) loadWebCalendar: (NSString *) location;
|
||||
- (void) deleteAllContent;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
|
||||
@implementation SOGoWebAppointmentFolder
|
||||
|
||||
- (void) deleteAllContent
|
||||
{
|
||||
[[self ocsFolder] deleteAllContent];
|
||||
}
|
||||
|
||||
- (int) loadWebCalendar: (NSString *) location
|
||||
{
|
||||
NSURL *url;
|
||||
@@ -57,7 +62,7 @@
|
||||
calendar = [iCalCalendar parseSingleFromSource: contents];
|
||||
if (calendar)
|
||||
{
|
||||
[[self ocsFolder] deleteAllContent];
|
||||
[self deleteAllContent];
|
||||
imported = [self importCalendar: calendar];
|
||||
}
|
||||
else
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
NSURL *url;
|
||||
NSString *name, *displayName;
|
||||
NSMutableDictionary *rc;
|
||||
SOGoAppointmentFolders *folders;
|
||||
int imported = 0;
|
||||
|
||||
r = [context request];
|
||||
@@ -53,13 +54,14 @@
|
||||
url = [NSURL URLWithString: [r formValueForKey: @"url"]];
|
||||
if (url)
|
||||
{
|
||||
folders = [self clientObject];
|
||||
displayName = [self displayNameForUrl: [r formValueForKey: @"url"]];
|
||||
[[self clientObject] newFolderWithName: displayName
|
||||
nameInContainer: &name];
|
||||
[folders newFolderWithName: displayName
|
||||
nameInContainer: &name];
|
||||
[self saveUrl: url forCalendar: name];
|
||||
folder = [[self clientObject] lookupName: name
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
folder = [folders lookupName: name
|
||||
inContext: context
|
||||
acquire: NO];
|
||||
if (folder)
|
||||
{
|
||||
imported = [folder loadWebCalendar: [r formValueForKey: @"url"]];
|
||||
|
||||
Reference in New Issue
Block a user