(feat) moved FolderSynchronize code to GCS

This commit is contained in:
Ludovic Marcotte
2015-09-25 15:18:22 -04:00
parent 8a3adeadd2
commit 5409cb2927
4 changed files with 26 additions and 58 deletions

View File

@@ -160,9 +160,6 @@ typedef enum {
- (NSString *) syncTag;
- (void) setSyncTag: (NSString *) newSyncTag;
- (BOOL) synchronizeCalendar;
- (void) setSynchronizeCalendar: (BOOL) new;
- (BOOL) includeInFreeBusy;
- (void) setIncludeInFreeBusy: (BOOL) newInclude;

View File

@@ -432,61 +432,6 @@ static Class iCalEventK = nil;
inCategory: @"FolderShowTasks"];
}
- (NSString *) syncTag
{
NSString *syncTag;
syncTag = [self folderPropertyValueInCategory: @"FolderSyncTags"];
if (!syncTag)
syncTag = @"";
return syncTag;
}
- (void) setSyncTag: (NSString *) newSyncTag
{
// Check for duplicated tags
SOGoUserSettings *settings;
NSDictionary *syncTags;
NSArray *values;
if ([newSyncTag length])
{
settings = [[context activeUser] userSettings];
syncTags = [[settings objectForKey: @"Calendar"]
objectForKey: @"FolderSyncTags"];
values = [syncTags allValues];
if (![values containsObject: newSyncTag])
[self setFolderPropertyValue: newSyncTag
inCategory: @"FolderSyncTags"];
}
else
[self setFolderPropertyValue: nil
inCategory: @"FolderSyncTags"];
}
- (BOOL) synchronizeCalendar
{
NSNumber *synchronize;
synchronize = [self folderPropertyValueInCategory: @"FolderSynchronize"];
return [synchronize boolValue];
}
- (void) setSynchronizeCalendar: (BOOL) new
{
NSNumber *synchronize;
if (new)
synchronize = [NSNumber numberWithBool: YES];
else
synchronize = nil;
[self setFolderPropertyValue: synchronize
inCategory: @"FolderSynchronize"];
}
//
// If the user is the owner of the calendar, by default we include the freebusy information.
//

View File

@@ -77,6 +77,9 @@
- (id) folderPropertyValueInCategory: (NSString *) theKey
forUser: (SOGoUser *) theUser;
- (BOOL) synchronize;
- (void) setSynchronize: (BOOL) new;
/* lower level fetches */
- (void) deleteEntriesWithIds: (NSArray *) ids;

View File

@@ -301,6 +301,29 @@ static NSArray *childRecordFields = nil;
return name;
}
- (BOOL) synchronize
{
NSNumber *synchronize;
synchronize = [self folderPropertyValueInCategory: @"FolderSynchronize"];
return [synchronize boolValue];
}
- (void) setSynchronize: (BOOL) new
{
NSNumber *synchronize;
if (new)
synchronize = [NSNumber numberWithBool: YES];
else
synchronize = nil;
[self setFolderPropertyValue: synchronize
inCategory: @"FolderSynchronize"];
}
/* This method fetches the display name defined by the owner, but is also the
fallback when a subscriber has not redefined the display name yet in their
environment. */