From 98fab548fbcb689823049edee9f70814e68b3d8c Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 12 Apr 2010 18:32:52 +0000 Subject: [PATCH] Monotone-Parent: 55bd0aadaff660782e65e1546472acf441f5dea3 Monotone-Revision: eafd57a183951ea94317f3d82256da0692581d9e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-04-12T18:32:52 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++ .../Appointments/SOGoAptMailNotification.h | 1 - SoObjects/Appointments/SOGoAptMailReceipt.h | 1 + SoObjects/Appointments/SOGoAptMailReceipt.m | 40 ++++++++++++++++++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 460075699..bb013f7ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-04-12 Wolfgang Sourdeau + * SoObjects/Appointments/SOGoAptMailReceipt.m (-getSubject) + (-getBody): taken methods from old version of + SOGoAptMailNotification, to avoid a crash regarding a lock of + method override. + * UI/WebServerResources/SOGoTabsController.js: new js module for handling tabs, replacing non-object code from generic.js. Added handling of tab overflows, with the appearance of two left/right diff --git a/SoObjects/Appointments/SOGoAptMailNotification.h b/SoObjects/Appointments/SOGoAptMailNotification.h index 36dec76dd..f3388be6a 100644 --- a/SoObjects/Appointments/SOGoAptMailNotification.h +++ b/SoObjects/Appointments/SOGoAptMailNotification.h @@ -43,7 +43,6 @@ NSTimeZone *viewTZ; NSCalendarDate *oldStartDate; NSCalendarDate *newStartDate; - BOOL isSubject; NSString *organizerName; NSMutableDictionary *values; } diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.h b/SoObjects/Appointments/SOGoAptMailReceipt.h index 8b8fc9ca9..58dbae3b9 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.h +++ b/SoObjects/Appointments/SOGoAptMailReceipt.h @@ -35,6 +35,7 @@ NSString *originator; NSArray *recipients; iCalPerson *currentRecipient; + BOOL isSubject; } - (void) setOriginator: (NSString *) newOriginator; diff --git a/SoObjects/Appointments/SOGoAptMailReceipt.m b/SoObjects/Appointments/SOGoAptMailReceipt.m index cc43d83e4..f85ffdc54 100644 --- a/SoObjects/Appointments/SOGoAptMailReceipt.m +++ b/SoObjects/Appointments/SOGoAptMailReceipt.m @@ -21,12 +21,16 @@ */ #import +#import #import +#import +#import #import #import +#import #import #import #import @@ -34,7 +38,7 @@ #import "SOGoAptMailReceipt.h" static SOGoUserManager *um = nil; - +static NSCharacterSet *wsSet = nil; @implementation SOGoAptMailReceipt @@ -42,6 +46,9 @@ static SOGoUserManager *um = nil; { if (!um) um = [SOGoUserManager sharedUserManager]; + + if (!wsSet) + wsSet = [[NSCharacterSet whitespaceAndNewlineCharacterSet] retain]; } - (id) init @@ -50,6 +57,7 @@ static SOGoUserManager *um = nil; { originator = nil; recipients = nil; + isSubject = NO; } return self; @@ -62,6 +70,36 @@ static SOGoUserManager *um = nil; [super dealloc]; } + +- (NSString *) getSubject +{ + NSString *subject; + + isSubject = YES; + subject = [[[self generateResponse] contentAsString] + stringByTrimmingCharactersInSet: wsSet]; + if (!subject) + { + [self errorWithFormat:@"Failed to properly generate subject! Please check " + @"template for component '%@'!", + [self name]]; + subject = @"ERROR: missing subject!"; + } + + return [subject asQPSubjectString: @"utf-8"]; +} + +- (NSString *) getBody +{ + NSString *body; + + isSubject = NO; + + body = [[self generateResponse] contentAsString]; + + return [body stringByTrimmingCharactersInSet: wsSet]; +} + - (void) setOriginator: (NSString *) newOriginator { ASSIGN (originator, newOriginator);