mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-05 16:35:10 +00:00
Monotone-Parent: 5348ab1ab933a8576fbc1f77ec5f02aab187101c
Monotone-Revision: c1871a78b402c35ce922ac5da7c7d2256dc9bb0c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-10-08T19:53:04 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -533,6 +533,8 @@ static NSArray *childRecordFields = nil;
|
||||
- (NSException *) delete
|
||||
{
|
||||
NSException *error;
|
||||
SOGoUserSettings *us;
|
||||
NSMutableDictionary *moduleSettings;
|
||||
|
||||
// We just fetch our displayName since our table will use it!
|
||||
[self displayName];
|
||||
@@ -543,8 +545,17 @@ static NSArray *childRecordFields = nil;
|
||||
else
|
||||
error = [[self folderManager] deleteFolderAtPath: ocsPath];
|
||||
|
||||
if (!error && [[context request] handledByDefaultHandler])
|
||||
[self sendFolderAdvisoryTemplate: @"Removal"];
|
||||
if (!error)
|
||||
{
|
||||
us = [[SOGoUser userWithLogin: owner] userSettings];
|
||||
moduleSettings = [us objectForKey: [container nameInContainer]];
|
||||
[self removeFolderSettings: moduleSettings
|
||||
withReference: [self folderReference]];
|
||||
[us synchronize];
|
||||
|
||||
if ([[context request] handledByDefaultHandler])
|
||||
[self sendFolderAdvisoryTemplate: @"Removal"];
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
@@ -839,7 +850,7 @@ static NSArray *childRecordFields = nil;
|
||||
NSDictionary *moduleSettings;
|
||||
NSArray *folderSubscription;
|
||||
|
||||
sogoUser = [SOGoUser userWithLogin: subscribingUser roles: nil];
|
||||
sogoUser = [SOGoUser userWithLogin: subscribingUser];
|
||||
moduleSettings = [[sogoUser userSettings]
|
||||
objectForKey: [container nameInContainer]];
|
||||
folderSubscription = [moduleSettings objectForKey: @"SubscribedFolders"];
|
||||
@@ -850,10 +861,10 @@ static NSArray *childRecordFields = nil;
|
||||
- (BOOL) subscribeUser: (NSString *) subscribingUser
|
||||
reallyDo: (BOOL) reallyDo
|
||||
{
|
||||
NSMutableArray *folderSubscription, *tmpA;
|
||||
NSMutableArray *folderSubscription;
|
||||
NSString *subscriptionPointer;
|
||||
SOGoUserSettings *us;
|
||||
NSMutableDictionary *moduleSettings, *tmpD;
|
||||
NSMutableDictionary *moduleSettings;
|
||||
SOGoUser *sogoUser;
|
||||
BOOL rc;
|
||||
|
||||
@@ -871,43 +882,29 @@ static NSArray *childRecordFields = nil;
|
||||
|
||||
folderSubscription
|
||||
= [moduleSettings objectForKey: @"SubscribedFolders"];
|
||||
if (!(folderSubscription
|
||||
&& [folderSubscription isKindOfClass: [NSMutableArray class]]))
|
||||
{
|
||||
folderSubscription = [NSMutableArray array];
|
||||
[moduleSettings setObject: folderSubscription
|
||||
forKey: @"SubscribedFolders"];
|
||||
}
|
||||
|
||||
subscriptionPointer = [self folderReference];
|
||||
|
||||
if (reallyDo)
|
||||
[folderSubscription addObjectUniquely: subscriptionPointer];
|
||||
{
|
||||
if (!(folderSubscription
|
||||
&& [folderSubscription isKindOfClass: [NSMutableArray class]]))
|
||||
{
|
||||
folderSubscription = [NSMutableArray array];
|
||||
[moduleSettings setObject: folderSubscription
|
||||
forKey: @"SubscribedFolders"];
|
||||
}
|
||||
|
||||
[folderSubscription addObjectUniquely: subscriptionPointer];
|
||||
}
|
||||
else
|
||||
{
|
||||
tmpD = [moduleSettings objectForKey: @"FolderColors"];
|
||||
if (tmpD)
|
||||
[tmpD removeObjectForKey: subscriptionPointer];
|
||||
|
||||
tmpD = [moduleSettings objectForKey: @"FolderShowAlarms"];
|
||||
if (tmpD)
|
||||
[tmpD removeObjectForKey: subscriptionPointer];
|
||||
|
||||
tmpD = [moduleSettings objectForKey: @"FolderShowTasks"];
|
||||
if (tmpD)
|
||||
[tmpD removeObjectForKey: subscriptionPointer];
|
||||
|
||||
tmpA = [moduleSettings objectForKey: @"InactiveFolders"];
|
||||
if (tmpA)
|
||||
[tmpA removeObject: nameInContainer];
|
||||
|
||||
tmpD = [moduleSettings objectForKey: @"FolderSyncTags"];
|
||||
if (tmpD)
|
||||
[tmpD removeObjectForKey: subscriptionPointer];
|
||||
|
||||
[self removeFolderSettings: moduleSettings
|
||||
withReference: subscriptionPointer];
|
||||
[folderSubscription removeObject: subscriptionPointer];
|
||||
}
|
||||
|
||||
[us synchronize];
|
||||
|
||||
rc = YES;
|
||||
}
|
||||
else
|
||||
@@ -916,6 +913,15 @@ static NSArray *childRecordFields = nil;
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) removeFolderSettings: (NSMutableDictionary *) moduleSettings
|
||||
withReference: (NSString *) reference
|
||||
{
|
||||
NSMutableDictionary *refDict;
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderDisplayNames"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
}
|
||||
|
||||
- (NSArray *) _parseDAVDelegatedUsers
|
||||
{
|
||||
id <DOMDocument> document;
|
||||
|
||||
Reference in New Issue
Block a user