Newly subscribed calendars are excluded from FB

Fixes #3354
This commit is contained in:
Francis Lachapelle
2017-05-30 09:40:04 -04:00
parent b3149ee7c2
commit 95d08c0150
3 changed files with 102 additions and 16 deletions
+5 -14
View File
@@ -970,8 +970,12 @@ static NSArray *childRecordFields = nil;
folderSubscription = [moduleSettings objectForKey: @"SubscribedFolders"];
subscriptionPointer = [self folderReference];
// We used to set "show alarms" for any type of folder, so we remove it
// here and let the subclass handle it (SOGoAppointmentFolder).
folderShowAlarms = [moduleSettings objectForKey: @"FolderShowAlarms"];
if (folderShowAlarms)
[folderShowAlarms removeObjectForKey: subscriptionPointer];
if (reallyDo)
{
@@ -983,30 +987,17 @@ static NSArray *childRecordFields = nil;
forKey: @"SubscribedFolders"];
}
if (!(folderShowAlarms
&& [folderShowAlarms isKindOfClass: [NSMutableDictionary class]]))
{
folderShowAlarms = [NSMutableDictionary dictionary];
[moduleSettings setObject: folderShowAlarms
forKey: @"FolderShowAlarms"];
}
[self setFolderPropertyValue: [self _displayNameFromSubscriber]
inCategory: @"FolderDisplayNames"
settings: us];
[folderSubscription addObjectUniquely: subscriptionPointer];
// By default, we disable alarms on subscribed calendars
[folderShowAlarms setObject: [NSNumber numberWithBool: NO]
forKey: subscriptionPointer];
}
else
{
[self removeFolderSettings: moduleSettings
withReference: subscriptionPointer];
[folderSubscription removeObject: subscriptionPointer];
[folderShowAlarms removeObjectForKey: subscriptionPointer];
}
[us synchronize];