Monotone-Parent: 6e1829513cdcf98135e56f857438e77218ae7851

Monotone-Revision: ef58e70b7d00dc34a5d02557365841c574086751

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-03-20T17:35:49
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2009-03-20 17:35:49 +00:00
1 parent 273415b671
commit 0ca3d9d7b0
2 files changed
+61 -39

No files matched your search

+7
View File
@@ -1,3 +1,10 @@
2009-03-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m ([SOGoUser -userDefaults]): ensure the
values are not nil before putting them in the cache. This fixes an
exception occuring for setting a nil key in a dictionary.
([SOGoUser -userSettings]): same as above.
2009-03-19 Francis Lachapelle <flachapelle@inverse.ca> 2009-03-19 Francis Lachapelle <flachapelle@inverse.ca>
* UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
+54 -39
View File
@@ -451,40 +451,47 @@ _timeValue (NSString *key)
- (NSUserDefaults *) userDefaults - (NSUserDefaults *) userDefaults
{ {
SOGoUserDefaults *defaults; SOGoUserDefaults *defaults;
NSDictionary *values;
NSMutableDictionary *d;
defaults = [[SOGoCache sharedCache] userDefaultsForLogin: login]; defaults = [[SOGoCache sharedCache] userDefaultsForLogin: login];
if (!defaults) if (!defaults)
{ {
NSMutableDictionary *d;
defaults = [self primaryUserDefaults]; defaults = [self primaryUserDefaults];
if (defaults)
{
// Required parameters for the Web interface
if (![[defaults stringForKey: @"ReplyPlacement"] length])
[defaults setObject: defaultReplyPlacement forKey: @"ReplyPlacement"];
if (![[defaults stringForKey: @"SignaturePlacement"] length])
[defaults setObject: defaultSignaturePlacement forKey: @"SignaturePlacement"];
if (![[defaults stringForKey: @"MessageForwarding"] length])
[defaults setObject: defaultMessageForwarding forKey: @"MessageForwarding"];
if (![[defaults stringForKey: @"MessageCheck"] length])
[defaults setObject: defaultMessageCheck forKey: @"MessageCheck"];
// Required parameters for the Web interface // We propagate the loaded user defaults to other sogod instances
if (![[defaults stringForKey: @"ReplyPlacement"] length]) // which will cache them in SOGoCache (including for the instance
[defaults setObject: defaultReplyPlacement forKey: @"ReplyPlacement"]; // that actually posts the notification)
if (![[defaults stringForKey: @"SignaturePlacement"] length]) values = [defaults values];
[defaults setObject: defaultSignaturePlacement forKey: @"SignaturePlacement"]; if (values)
if (![[defaults stringForKey: @"MessageForwarding"] length]) {
[defaults setObject: defaultMessageForwarding forKey: @"MessageForwarding"]; d = [NSMutableDictionary dictionary];
if (![[defaults stringForKey: @"MessageCheck"] length]) [d setObject: values forKey: @"values"];
[defaults setObject: defaultMessageCheck forKey: @"MessageCheck"]; [d setObject: login forKey: @"uid"];
[d setObject: [SOGoProfileURL absoluteString] forKey: @"url"];
// We propagate the loaded user defaults to other sogod instances [[SOGoCache sharedCache] setDefaults: defaults
// which will cache them in SOGoCache (including for the instance forLogin: login key: @"defaults"];
// that actually posts the notification)
d = [NSMutableDictionary dictionary];
[d setObject: [defaults values] forKey: @"values"];
[d setObject: login forKey: @"uid"];
[d setObject: [SOGoProfileURL absoluteString] forKey: @"url"];
[[SOGoCache sharedCache] setDefaults: defaults forLogin: login key: @"defaults"]; [[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"SOGoUserDefaultsHaveLoaded"
[[NSDistributedNotificationCenter defaultCenter] object: nil
postNotificationName: @"SOGoUserDefaultsHaveLoaded" userInfo: d
object: nil deliverImmediately: YES];
userInfo: d }
deliverImmediately: YES]; }
} }
//else //else
// NSLog(@"User defaults cache hit for %@", login); // NSLog(@"User defaults cache hit for %@", login);
@@ -495,6 +502,7 @@ _timeValue (NSString *key)
- (NSUserDefaults *) userSettings - (NSUserDefaults *) userSettings
{ {
SOGoUserDefaults *settings; SOGoUserDefaults *settings;
NSDictionary *values;
settings = [[SOGoCache sharedCache] userSettingsForLogin: login]; settings = [[SOGoCache sharedCache] userSettingsForLogin: login];
@@ -503,22 +511,29 @@ _timeValue (NSString *key)
NSMutableDictionary *d; NSMutableDictionary *d;
settings = [self primaryUserSettings]; settings = [self primaryUserSettings];
[settings fetchProfile]; if (settings)
// We propagate the loaded user settings to other sogod instances {
// which will cache them in SOGoCache (including for the instance [settings fetchProfile];
// that actually posts the notification) values = [settings values];
d = [NSMutableDictionary dictionary]; if (values)
[d setObject: [settings values] forKey: @"values"]; {
[d setObject: login forKey: @"uid"]; // We propagate the loaded user settings to other sogod instances
[d setObject: [SOGoProfileURL absoluteString] forKey: @"url"]; // which will cache them in SOGoCache (including for the instance
// that actually posts the notification)
d = [NSMutableDictionary dictionary];
[d setObject: values forKey: @"values"];
[d setObject: login forKey: @"uid"];
[d setObject: [SOGoProfileURL absoluteString] forKey: @"url"];
[[SOGoCache sharedCache] setDefaults: settings forLogin: login key: @"settings"]; [[SOGoCache sharedCache] setDefaults: settings forLogin: login key: @"settings"];
[[NSDistributedNotificationCenter defaultCenter] [[NSDistributedNotificationCenter defaultCenter]
postNotificationName: @"SOGoUserSettingsHaveLoaded" postNotificationName: @"SOGoUserSettingsHaveLoaded"
object: nil object: nil
userInfo: d userInfo: d
deliverImmediately: YES]; deliverImmediately: YES];
}
}
} }
//else //else
// NSLog(@"User settings cache hit for %@", login); // NSLog(@"User settings cache hit for %@", login);