From bdfab579525f94675a36706efaeef12604788c83 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 17 Nov 2006 22:26:32 +0000 Subject: [PATCH] Monotone-Parent: 86da832914b740fbc3a80b28be7c9ec5a3510fe1 Monotone-Revision: dedd03390a80d0dd2deb9021e1f8f52cb52be8e6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-11-17T22:26:32 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/SOGo/SOGoObject.m | 15 +++++++++++++++ 2 files changed, 20 insertions(+) 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 {