diff --git a/ChangeLog b/ChangeLog index 7e0c4236f..fa081da99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-11-17 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject + -userTimeZone:username]): new method that returns the timezone for + the specified user depending on his preferences and the server + defaults. + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject -stringForData:partInfo:]): take the encoding into account and translate the text to "normal" before processing the charset data. diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 8c0fcd1e5..8a15dd536 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -22,6 +22,7 @@ #import "SOGoUser.h" #import "SOGoObject.h" #import "SOGoUserFolder.h" +#import "AgenorUserManager.h" #import #import #import "common.h" @@ -414,6 +415,20 @@ static NSTimeZone *serverTimeZone = nil; return userTimeZone; } +- (NSTimeZone *) userTimeZone: (NSString *) username +{ + NSUserDefaults *userPrefs; + AgenorUserManager *am; + + am = [AgenorUserManager sharedUserManager]; + userPrefs = [am getUserDefaultsForUID: username]; + userTimeZone = [NSTimeZone timeZoneWithName: [userPrefs stringForKey: @"timezonename"]]; + if (!userTimeZone) + userTimeZone = [self serverTimeZone]; + + return userTimeZone; +} + /* description */ - (void)appendAttributesToDescription:(NSMutableString *)_ms {