mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 03:15:25 +00:00
Monotone-Parent: af54238ee1f81a070c6197fca70d25f2fefd747a
Monotone-Revision: bac780b4aa8bbfe357fc35ac9eb62f1fba1e2938 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-29T00:14:01 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
2007-06-28 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/WOContext+UIxMailer.m ([WOContext
|
||||
-mailDateFormatter]): returns the user's date formatter.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject -date]):
|
||||
applies the user timezone to the date object before returning it.
|
||||
|
||||
|
||||
@@ -19,47 +19,37 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "WOContext+UIxMailer.h"
|
||||
#include "UIxMailFormatter.h"
|
||||
#include "common.h"
|
||||
|
||||
#include <SoObjects/SOGo/SOGoUser.h>
|
||||
#import <SoObjects/SOGo/SOGoDateFormatter.h>
|
||||
#import <SoObjects/SOGo/SOGoUser.h>
|
||||
|
||||
#import "UIxMailFormatter.h"
|
||||
#import "common.h"
|
||||
|
||||
#import "WOContext+UIxMailer.h"
|
||||
|
||||
@implementation WOContext(UIxMailer)
|
||||
|
||||
// TODO: make configurable
|
||||
// TODO: cache!
|
||||
|
||||
- (NSFormatter *)mailSubjectFormatter {
|
||||
- (NSFormatter *) mailSubjectFormatter
|
||||
{
|
||||
return [[[UIxSubjectFormatter alloc] init] autorelease];
|
||||
}
|
||||
|
||||
- (NSFormatter *)mailDateFormatter
|
||||
- (NSFormatter *) mailDateFormatter
|
||||
{
|
||||
NSTimeZone *userTZ;
|
||||
NSString *userTZString;
|
||||
id userPrefs;
|
||||
static id dateFormatter = nil;
|
||||
|
||||
if (!dateFormatter)
|
||||
{
|
||||
dateFormatter = [UIxMailDateFormatter new];
|
||||
userPrefs = [[self activeUser] userDefaults];
|
||||
userTZString = [userPrefs stringForKey: @"timezonename"];
|
||||
if ([userTZString length] > 0)
|
||||
{
|
||||
userTZ = [NSTimeZone timeZoneWithName: userTZString];
|
||||
[dateFormatter setTimeZone: userTZ];
|
||||
}
|
||||
}
|
||||
|
||||
return dateFormatter;
|
||||
return [[self activeUser] dateFormatterInContext: self];
|
||||
}
|
||||
|
||||
- (NSFormatter *)mailEnvelopeAddressFormatter {
|
||||
- (NSFormatter *) mailEnvelopeAddressFormatter
|
||||
{
|
||||
return [[[UIxEnvelopeAddressFormatter alloc] init] autorelease];
|
||||
}
|
||||
- (NSFormatter *)mailEnvelopeFullAddressFormatter {
|
||||
|
||||
- (NSFormatter *) mailEnvelopeFullAddressFormatter
|
||||
{
|
||||
return [[[UIxEnvelopeAddressFormatter alloc]
|
||||
initWithMaxLength:256 generateFullEMail:YES] autorelease];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user