mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-18 03:38:49 +00:00
(feat) moved FolderSynchronize code to GCS
This commit is contained in:
@@ -160,9 +160,6 @@ typedef enum {
|
||||
- (NSString *) syncTag;
|
||||
- (void) setSyncTag: (NSString *) newSyncTag;
|
||||
|
||||
- (BOOL) synchronizeCalendar;
|
||||
- (void) setSynchronizeCalendar: (BOOL) new;
|
||||
|
||||
- (BOOL) includeInFreeBusy;
|
||||
- (void) setIncludeInFreeBusy: (BOOL) newInclude;
|
||||
|
||||
|
||||
@@ -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.
|
||||
//
|
||||
|
||||
@@ -77,6 +77,9 @@
|
||||
- (id) folderPropertyValueInCategory: (NSString *) theKey
|
||||
forUser: (SOGoUser *) theUser;
|
||||
|
||||
- (BOOL) synchronize;
|
||||
- (void) setSynchronize: (BOOL) new;
|
||||
|
||||
/* lower level fetches */
|
||||
- (void) deleteEntriesWithIds: (NSArray *) ids;
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user