mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-07 22:38:51 +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:
15
ChangeLog
15
ChangeLog
@@ -1,5 +1,20 @@
|
||||
2010-10-08 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/Appointments/SOGoAppointmentFolder.m
|
||||
(-removeFolderSettings:withReference:): new method which removes
|
||||
the settings for keys "FreeBusyExclusions", "FolderColors",
|
||||
"FolderShowAlarms", "FolderShowTasks", "InactiveFolders",
|
||||
"FolderSyncTags" and "FolderSynchronize". Code taken from
|
||||
-[SOGoGCSFolder subscribeUser:reallyDo:].
|
||||
|
||||
* SoObjects/SOGo/SOGoGCSFolder.m
|
||||
(-removeFolderSettings:withReference:): new overridable method
|
||||
which enables the removal of user settings pertaining to a folder
|
||||
and its type when deleting the folder or unsubscribing from it.
|
||||
This implementation removes the folder reference from the
|
||||
"FolderDisplayNames" key.
|
||||
(-delete): make use of the new method above.
|
||||
|
||||
* UI/WebServerResources/ContactsUI.js: (setEventsOnAddressBook)
|
||||
enable the "dblclick" event on non-owned addressbooks, except the
|
||||
public ones (owned by "nobody")
|
||||
|
||||
@@ -2247,6 +2247,37 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||
return rc;
|
||||
}
|
||||
|
||||
- (void) removeFolderSettings: (NSMutableDictionary *) moduleSettings
|
||||
withReference: (NSString *) reference
|
||||
{
|
||||
NSMutableArray *refArray;
|
||||
NSMutableDictionary *refDict;
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FreeBusyExclusions"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderColors"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderShowAlarms"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderShowTasks"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
refArray = [moduleSettings objectForKey: @"InactiveFolders"];
|
||||
[refArray removeObject: nameInContainer];
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderSyncTags"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
refDict = [moduleSettings objectForKey: @"FolderSynchronize"];
|
||||
[refDict removeObjectForKey: reference];
|
||||
|
||||
[super removeFolderSettings: moduleSettings
|
||||
withReference: reference];
|
||||
}
|
||||
|
||||
- (id) lookupHomeFolderForUID: (NSString *) _uid
|
||||
inContext: (id)_ctx
|
||||
{
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
- (NSException *) delete;
|
||||
- (void) renameTo: (NSString *) newName;
|
||||
|
||||
- (void) removeFolderSettings: (NSMutableDictionary *) moduleSettings
|
||||
withReference: (NSString *) reference;
|
||||
|
||||
- (BOOL) subscribeUser: (NSString *) subscribingUser
|
||||
reallyDo: (BOOL) reallyDo;
|
||||
- (BOOL) userIsSubscriber: (NSString *) subscribingUser;
|
||||
|
||||
@@ -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