mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-22 06:42:44 +00:00
Automatically disable alarms for newly subsribed calendars.
This fixes bug #2074.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* SOGoGCSFolder.m - this file is part of SOGo
|
||||
*
|
||||
* Copyright (C) 2004-2005 SKYRIX Software AG
|
||||
* Copyright (C) 2006-2010 Inverse inc.
|
||||
* Copyright (C) 2006-2012 Inverse inc.
|
||||
*
|
||||
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
*
|
||||
@@ -835,7 +835,7 @@ static NSArray *childRecordFields = nil;
|
||||
- (BOOL) subscribeUserOrGroup: (NSString *) theIdentifier
|
||||
reallyDo: (BOOL) reallyDo
|
||||
{
|
||||
NSMutableDictionary *moduleSettings;
|
||||
NSMutableDictionary *moduleSettings, *folderShowAlarms;
|
||||
NSMutableArray *folderSubscription;
|
||||
NSString *subscriptionPointer;
|
||||
NSMutableArray *allUsers;
|
||||
@@ -886,6 +886,8 @@ static NSArray *childRecordFields = nil;
|
||||
folderSubscription
|
||||
= [moduleSettings objectForKey: @"SubscribedFolders"];
|
||||
subscriptionPointer = [self folderReference];
|
||||
|
||||
folderShowAlarms = [moduleSettings objectForKey: @"FolderShowAlarms"];
|
||||
|
||||
if (reallyDo)
|
||||
{
|
||||
@@ -897,14 +899,26 @@ static NSArray *childRecordFields = nil;
|
||||
forKey: @"SubscribedFolders"];
|
||||
}
|
||||
|
||||
if (!(folderShowAlarms
|
||||
&& [folderShowAlarms isKindOfClass: [NSMutableDictionary class]]))
|
||||
{
|
||||
folderShowAlarms = [NSMutableDictionary dictionary];
|
||||
[moduleSettings setObject: folderShowAlarms
|
||||
forKey: @"FolderShowAlarms"];
|
||||
}
|
||||
|
||||
[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];
|
||||
|
||||
Reference in New Issue
Block a user