From: wolfgang Date: Tue, 10 Jul 2007 19:27:48 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1101 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f622f8e3a5550bba910e041cab6b28f07ff82281;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1101 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index f64b2b05..607614a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2007-07-10 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailBaseObject.m ([SOGoMailBaseObject + -imap4URL]): rewrote method to support accented mailbox names. + ([SOGoMailBaseObject imap4Password]): rewrote to simply use + SOGoAuthenticator's passwordInContext:. + + * UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor + -takeValuesFromRequest:_rqinContext:_ctx]): explicitly set the + start and due dates to nil if hasStartDate and hasDueDate are + false. + + * SoObjects/SOGo/SOGoAuthenticator.m ([SOGoAuthenticator + -passwordInContext:context]): made method public. + + * OGoContentStore/OCSiCalFieldExtractor.m ([OCSiCalFieldExtractor + -extractQuickFieldsFromTodo:_task]): set "isallday" and "isopaque" + to false to avoid a null violation. + 2007-07-04 Wolfgang Sourdeau * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject diff --git a/NEWS b/NEWS index ab0830fb..e003261c 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,17 @@ 0.9.0 (200707XX) ---------------- -- added the ability to specify a super user through the SOGoSuperUsername user default; +- added the ability to specify a super user through the SOGoSuperUsername user + default; - added the ability to view the message source; - no longer autocreate folders if we are not their owners; - made compatible with PostgreSQL 8.2; - the months and years menus of the date selector would no longer appear; +- fixed a bug which would produce task SQL records which would violate + non-null constraints on the quick calendar tables; +- it was impossible to reset the start and the due date in the task editor + whenever they were set once; +- imap folders with non-ascii characters are now correctly accessed; + +Local variables: +mode: text +End: diff --git a/OGoContentStore/OCSContactFieldExtractor.m b/OGoContentStore/OCSContactFieldExtractor.m index 675ea7e8..f1f6a56b 100644 --- a/OGoContentStore/OCSContactFieldExtractor.m +++ b/OGoContentStore/OCSContactFieldExtractor.m @@ -19,9 +19,12 @@ 02111-1307, USA. */ +#import +#import +#import + #import #import -#import "common.h" @interface OCSContactFieldExtractor : GCSFieldExtractor @end diff --git a/OGoContentStore/OCSiCalFieldExtractor.m b/OGoContentStore/OCSiCalFieldExtractor.m index 9b8678f7..9a6188d1 100644 --- a/OGoContentStore/OCSiCalFieldExtractor.m +++ b/OGoContentStore/OCSiCalFieldExtractor.m @@ -19,11 +19,18 @@ 02111-1307, USA. */ -#include "OCSiCalFieldExtractor.h" -#include "common.h" -#include -#include "iCalEntityObject+OCS.h" -#include "iCalRepeatableEntityObject+OCS.h" +#import +#import +#import +#import + +#import +#import + +#import "iCalEntityObject+OCS.h" +#import "iCalRepeatableEntityObject+OCS.h" + +#import "OCSiCalFieldExtractor.h" @implementation OCSiCalFieldExtractor @@ -250,6 +257,11 @@ static NSNumber *distantFutureNumber = nil; [row setObject:[NSNumber numberWithInt:[_task priorityNumber]] forKey: @"priority"]; + [row setObject: [NSNumber numberWithBool: NO] + forKey: @"isallday"]; + [row setObject: [NSNumber numberWithBool: NO] + forKey: @"isopaque"]; + if ([title isNotNull]) [row setObject: title forKey: @"title"]; if ([location isNotNull]) [row setObject: location forKey: @"location"]; if ([sequence isNotNull]) [row setObject: sequence forKey: @"sequence"]; @@ -342,14 +354,12 @@ static NSNumber *distantFutureNumber = nil; } - (NSMutableDictionary *)extractQuickFieldsFromContent:(NSString *)_content { - NSAutoreleasePool *pool; NSDictionary *fields; id cal; if ([_content length] == 0) return nil; - pool = [[NSAutoreleasePool alloc] init]; cal = [iCalCalendar parseSingleFromSource: _content]; fields = nil; @@ -370,8 +380,6 @@ static NSNumber *distantFutureNumber = nil; else [self logWithFormat: @"ERROR: parsing source didn't return anything"]; - [pool release]; - return [fields autorelease]; } diff --git a/OGoContentStore/common.h b/OGoContentStore/common.h deleted file mode 100644 index 8dde8af2..00000000 --- a/OGoContentStore/common.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2004 SKYRIX Software AG - - This file is part of OpenGroupware.org. - - OGo is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - OGo is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with OGo; see the file COPYING. If not, write to the - Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. -*/ -// $Id$ - -#import -#import - -#include - -#if NeXT_RUNTIME || APPLE_RUNTIME -# define objc_free(__mem__) free(__mem__) -# define objc_malloc(__size__) malloc(__size__) -# define objc_calloc(__cnt__, __size__) calloc(__cnt__, __size__) -# define objc_realloc(__ptr__, __size__) realloc(__ptr__, __size__) -# ifndef sel_eq -# define sel_eq(sela,selb) (sela==selb?YES:NO) -# endif -#endif diff --git a/OGoContentStore/iCalEntityObject+OCS.m b/OGoContentStore/iCalEntityObject+OCS.m index 6ff911c8..e95f8484 100644 --- a/OGoContentStore/iCalEntityObject+OCS.m +++ b/OGoContentStore/iCalEntityObject+OCS.m @@ -19,8 +19,7 @@ 02111-1307, USA. */ -#include "iCalEntityObject+OCS.h" -#include "common.h" +#import "iCalEntityObject+OCS.h" @implementation iCalEntityObject (OCS) diff --git a/OGoContentStore/iCalRepeatableEntityObject+OCS.m b/OGoContentStore/iCalRepeatableEntityObject+OCS.m index 5bedb6e2..191a4403 100644 --- a/OGoContentStore/iCalRepeatableEntityObject+OCS.m +++ b/OGoContentStore/iCalRepeatableEntityObject+OCS.m @@ -19,8 +19,10 @@ 02111-1307, USA. */ -#include "iCalRepeatableEntityObject+OCS.h" -#include "common.h" +#import +#import + +#import "iCalRepeatableEntityObject+OCS.h" @implementation iCalRepeatableEntityObject (OCS) diff --git a/OGoContentStore/test_quick_extract.m b/OGoContentStore/test_quick_extract.m index b2e46796..eb728f83 100644 --- a/OGoContentStore/test_quick_extract.m +++ b/OGoContentStore/test_quick_extract.m @@ -20,9 +20,15 @@ */ +#import +#import #import +#import +#import -@class NSArray; +#import + +#import @interface TestQuickExtract : NSObject @@ -30,9 +36,6 @@ @end -#include -#include "common.h" - @implementation TestQuickExtract - (int)usage:(NSArray *)_args { diff --git a/SOPE/NGCards/ChangeLog b/SOPE/NGCards/ChangeLog index 1431e6f2..911fbddf 100644 --- a/SOPE/NGCards/ChangeLog +++ b/SOPE/NGCards/ChangeLog @@ -1,3 +1,9 @@ +2007-07-10 Wolfgang Sourdeau + + * iCalToDo.m ([iCalToDo -setDue:newDueDate]): use setDateTime: + instead of setDate: because the latter sets an "all day" + timestamp. + 2007-07-03 Wolfgang Sourdeau * iCalRecurrenceRule.m ([iCalRecurrenceRule diff --git a/SOPE/NGCards/iCalToDo.m b/SOPE/NGCards/iCalToDo.m index 0319f2d6..915589b7 100644 --- a/SOPE/NGCards/iCalToDo.m +++ b/SOPE/NGCards/iCalToDo.m @@ -59,7 +59,7 @@ - (void) setDue: (NSCalendarDate *) newDueDate { [(iCalDateTime *) [self uniqueChildWithTag: @"due"] - setDate: newDueDate]; + setDateTime: newDueDate]; } - (NSCalendarDate *) due diff --git a/SoObjects/Appointments/common.h b/SoObjects/Appointments/common.h index acd6f20f..c3c5c3ae 100644 --- a/SoObjects/Appointments/common.h +++ b/SoObjects/Appointments/common.h @@ -29,3 +29,5 @@ #include #include #include + +#warning importing common.h is baaad diff --git a/SoObjects/Contacts/common.h b/SoObjects/Contacts/common.h index e213fd75..d22e20bf 100644 --- a/SoObjects/Contacts/common.h +++ b/SoObjects/Contacts/common.h @@ -31,3 +31,4 @@ #include #include +#warning importing common.h is baaad diff --git a/SoObjects/Mailer/Product.m b/SoObjects/Mailer/Product.m index f53e63f7..e8706926 100644 --- a/SoObjects/Mailer/Product.m +++ b/SoObjects/Mailer/Product.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id$ #import diff --git a/SoObjects/Mailer/SOGoCalendarMailBodyPart.m b/SoObjects/Mailer/SOGoCalendarMailBodyPart.m index b001b8b7..714c0bc4 100644 --- a/SoObjects/Mailer/SOGoCalendarMailBodyPart.m +++ b/SoObjects/Mailer/SOGoCalendarMailBodyPart.m @@ -40,14 +40,4 @@ @implementation SOGoCalendarMailBodyPart -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} - @end /* SOGoCalendarMailBodyPart */ diff --git a/SoObjects/Mailer/SOGoDraftObject.m b/SoObjects/Mailer/SOGoDraftObject.m index 92e99648..8bd8ab98 100644 --- a/SoObjects/Mailer/SOGoDraftObject.m +++ b/SoObjects/Mailer/SOGoDraftObject.m @@ -88,17 +88,9 @@ static BOOL draftDeleteDisabled = NO; // for debugging static BOOL debugOn = NO; static BOOL showTextAttachmentsInline = NO; -+ (int)version { - return [super version] + 0 /* v1 */; -} - + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - /* Note: be aware of the charset issues before enabling this! */ showTextAttachmentsInline = [ud boolForKey:@"SOGoShowTextAttachmentsInline"]; diff --git a/SoObjects/Mailer/SOGoDraftsFolder.m b/SoObjects/Mailer/SOGoDraftsFolder.m index 00195374..13655da0 100644 --- a/SoObjects/Mailer/SOGoDraftsFolder.m +++ b/SoObjects/Mailer/SOGoDraftsFolder.m @@ -30,17 +30,9 @@ static NSString *spoolFolder = nil; -+ (int)version { - return [super version] + 0 /* v1 */; -} - + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - spoolFolder = [[ud stringForKey:@"SOGoMailSpoolPath"] copy]; if ([spoolFolder length] < 3) spoolFolder = @"/tmp/"; diff --git a/SoObjects/Mailer/SOGoImageMailBodyPart.m b/SoObjects/Mailer/SOGoImageMailBodyPart.m index b2b94ff2..0319ac00 100644 --- a/SoObjects/Mailer/SOGoImageMailBodyPart.m +++ b/SoObjects/Mailer/SOGoImageMailBodyPart.m @@ -40,14 +40,4 @@ @implementation SOGoImageMailBodyPart -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} - @end /* SOGoImageMailBodyPart */ diff --git a/SoObjects/Mailer/SOGoMailAccount.m b/SoObjects/Mailer/SOGoMailAccount.m index be0cea9f..b82b1451 100644 --- a/SoObjects/Mailer/SOGoMailAccount.m +++ b/SoObjects/Mailer/SOGoMailAccount.m @@ -37,18 +37,10 @@ static NSString *sharedFolderName = @""; // TODO: add English default static NSString *otherUsersFolderName = @""; // TODO: add English default static BOOL useAltNamespace = NO; -+ (int)version { - return [super version] + 0 /* v1 */; -} - + (void)initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; NSString *cfgDraftsFolderName; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - useAltNamespace = [ud boolForKey:@"SOGoSpecialFoldersInRoot"]; sharedFolderName = [ud stringForKey:@"SOGoSharedFolderName"]; @@ -183,48 +175,29 @@ static BOOL useAltNamespace = NO; return [creds objectAtIndex:0]; /* the user */ } -- (NSString *)imap4URLString { +- (NSMutableString *) imap4URLString +{ /* private, overridden by SOGoSharedMailAccount */ - NSString *s; - NSRange r; - - s = [self nameInContainer]; - r = [s rangeOfString:@"@"]; - if (r.length == 0) { - NSString *u; - - u = [self imap4LoginFromHTTP]; - if ([u length] == 0) { - [self errorWithFormat:@"missing login in account folder name: %@", s]; - return nil; - } - s = [[u stringByAppendingString:@"@"] stringByAppendingString:s]; - } - if ([s hasSuffix:@":80"]) { // HACK - [self logWithFormat:@"WARNING: incorrect value for IMAP4 URL: '%@'", s]; - s = [s substringToIndex:([s length] - 3)]; - } - - s = [([self useSSL] ? @"imaps://" : @"imap://") stringByAppendingString:s]; - s = [s stringByAppendingString:@"/"]; - return s; -} + NSMutableString *urlString; + NSString *host; -- (NSURL *)imap4URL { - /* imap://agenortest@mail.opengroupware.org/ */ - NSString *s; - - if (self->imap4URL != nil) - return self->imap4URL; + urlString = [NSMutableString string]; - if ((s = [self imap4URLString]) == nil) - return nil; - - self->imap4URL = [[NSURL alloc] initWithString:s]; - return self->imap4URL; + if ([self useSSL]) + [urlString appendString: @"imaps://"]; + else + [urlString appendString: @"imap://"]; + + host = [self nameInContainer]; + if (![host rangeOfString: @"@"].length) + [urlString appendFormat: @"%@@", [self imap4LoginFromHTTP]]; + [urlString appendFormat: @"%@/", host]; + + return urlString; } -- (NSString *)imap4Login { +- (NSString *) imap4Login +{ return [[self imap4URL] user]; } @@ -331,22 +304,22 @@ static BOOL useAltNamespace = NO; // TODO: use some profile to determine real location, use a -traverse lookup SOGoMailFolder *folder; - if (self->inboxFolder != nil) - return self->inboxFolder; + if (inboxFolder != nil) + return inboxFolder; folder = [self lookupName:[self inboxFolderNameInContext:_ctx] inContext:_ctx acquire:NO]; if ([folder isKindOfClass:[NSException class]]) return folder; - return ((self->inboxFolder = [folder retain])); + return ((inboxFolder = [folder retain])); } - (SOGoMailFolder *)sentFolderInContext:(id)_ctx { // TODO: use some profile to determine real location, use a -traverse lookup SOGoMailFolder *folder; - if (self->sentFolder != nil) - return self->sentFolder; + if (sentFolder != nil) + return sentFolder; folder = useAltNamespace ? (id)self : [self inboxFolderInContext:_ctx]; if ([folder isKindOfClass:[NSException class]]) return folder; @@ -360,15 +333,15 @@ static BOOL useAltNamespace = NO; reason:@"did not find Sent folder!"]; } - return ((self->sentFolder = [folder retain])); + return ((sentFolder = [folder retain])); } - (SOGoMailFolder *)trashFolderInContext:(id)_ctx { // TODO: use some profile to determine real location SOGoMailFolder *folder; - if (self->trashFolder != nil) - return self->trashFolder; + if (trashFolder != nil) + return trashFolder; folder = useAltNamespace ? (id)self : [self inboxFolderInContext:_ctx]; if ([folder isKindOfClass:[NSException class]]) return folder; @@ -382,7 +355,7 @@ static BOOL useAltNamespace = NO; reason:@"did not find Trash folder!"]; } - return ((self->trashFolder = [folder retain])); + return ((trashFolder = [folder retain])); } /* WebDAV */ diff --git a/SoObjects/Mailer/SOGoMailBaseObject.m b/SoObjects/Mailer/SOGoMailBaseObject.m index af97cb7c..4ba1c62c 100644 --- a/SoObjects/Mailer/SOGoMailBaseObject.m +++ b/SoObjects/Mailer/SOGoMailBaseObject.m @@ -19,125 +19,158 @@ 02111-1307, USA. */ -#include "SOGoMailBaseObject.h" -#include "SOGoMailManager.h" -#include "common.h" -#include -#include -#include +#import +#import +#import +#import +#import +#import -@implementation SOGoMailBaseObject +#import -+ (int)version { - return [super version] + 1 /* v1 */; -} -+ (void)initialize { - NSAssert2([super version] == 0, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} +#import "SOGoMailManager.h" + +#import "SOGoMailBaseObject.h" + +@implementation SOGoMailBaseObject #if 0 static BOOL debugOn = YES; #endif -- (id)initWithImap4URL:(NSURL *)_url inContainer:(id)_container { +- (id) initWithImap4URL: (NSURL *) _url + inContainer: (id) _container +{ NSString *n; n = [[_url path] lastPathComponent]; - if ((self = [self initWithName:n inContainer:_container])) { - self->imap4URL = [_url retain]; - } + if ((self = [self initWithName: n inContainer:_container])) + { + imap4URL = [_url retain]; + } + return self; } -- (void)dealloc { - [self->imap4URL release]; +- (void) dealloc +{ + [imap4URL release]; [super dealloc]; } /* hierarchy */ -- (SOGoMailAccount *)mailAccountFolder { - if (![[self container] respondsToSelector:_cmd]) { - [self warnWithFormat:@"weird container of mailfolder: %@", - [self container]]; - return nil; - } +- (SOGoMailAccount *) mailAccountFolder +{ + SOGoMailAccount *folder; + + if ([container respondsToSelector:_cmd]) + folder = [container mailAccountFolder]; + else + { + [self warnWithFormat: @"weird container of mailfolder: %@", + container]; + folder = nil; + } - return [[self container] mailAccountFolder]; + return folder; } -- (SOGoMailAccounts *)mailAccountsFolder { +- (SOGoMailAccounts *) mailAccountsFolder +{ id o; - - for (o = [self container]; [o isNotNull]; o = [o container]) { - if ([o isKindOfClass:NSClassFromString(@"SOGoMailAccounts")]) - return o;; - } - return nil; + SOGoMailAccounts *folder; + Class folderClass; + + folder = nil; + + folderClass = NSClassFromString (@"SOGoMailAccounts"); + o = container; + while (!folder && [o isNotNull]) + if ([o isKindOfClass: folderClass]) + folder = o; + else + o = [o container]; + + return o; } /* IMAP4 */ -- (NGImap4ConnectionManager *)mailManager { +- (NGImap4ConnectionManager *) mailManager +{ return [NGImap4ConnectionManager defaultConnectionManager]; } -- (NGImap4Connection *)imap4Connection { - if (self->imap4 == nil) { - self->imap4 = [[[self mailManager] connectionForURL:[self imap4URL] - password:[self imap4Password]] retain]; - if (self->imap4 == nil) { - [self errorWithFormat:@"Could not connect IMAP4."]; - self->imap4 = [[NSNull null] retain]; + +- (NGImap4Connection *) imap4Connection +{ + if (!imap4) + { + imap4 = [[self mailManager] connectionForURL: [self imap4URL] + password: [self imap4Password]]; + if (imap4) + [imap4 retain]; + else + [self errorWithFormat:@"Could not connect IMAP4."]; } - } - return [self->imap4 isNotNull] ? self->imap4 : nil; + + return imap4; } -- (NSString *)relativeImap4Name { - [self warnWithFormat:@"subclass should override %@", - NSStringFromSelector(_cmd)]; +- (NSString *) relativeImap4Name +{ + [self subclassResponsibility: _cmd]; + return nil; } -- (NSURL *)baseImap4URL { - if (![[self container] respondsToSelector:@selector(imap4URL)]) { - [self warnWithFormat:@"container does not implement -imap4URL!"]; - return nil; - } + +- (NSURL *) baseImap4URL +{ + NSURL *url; + + if ([container respondsToSelector:@selector(imap4URL)]) + url = [container imap4URL]; + else + { + [self warnWithFormat:@"container does not implement -imap4URL!"]; + url = nil; + } - return [[self container] imap4URL]; + return url; } -- (NSURL *)imap4URL { - NSString *sn; - NSURL *base; - - if (self->imap4URL != nil) - return self->imap4URL; - - if ((sn = [self relativeImap4Name]) == nil) - return nil; - - if (![[self container] respondsToSelector:_cmd]) { - [self warnWithFormat:@"container does not implement -imap4URL!"]; - return nil; - } - - if ((base = [self baseImap4URL]) == nil) - return nil; - - sn = [[base path] stringByAppendingPathComponent:sn]; - self->imap4URL = [[NSURL alloc] initWithString:sn relativeToURL:base]; - return self->imap4URL; + +- (NSMutableString *) imap4URLString +{ + NSMutableString *urlString; + + urlString = [container imap4URLString]; + [urlString appendFormat: @"%@/", [nameInContainer stringByEscapingURL]]; + + return urlString; } -- (NSString *)imap4Login { - if (![[self container] respondsToSelector:_cmd]) +- (NSURL *) imap4URL +{ + /* this could probably be handled better from NSURL but it's buggy in + GNUstep */ + if (!imap4URL) + { + imap4URL = [[NSURL alloc] initWithString: [self imap4URLString]]; + } + + return imap4URL; +} + +- (NSString *) imap4Login +{ + if (![container respondsToSelector:_cmd]) return nil; - return [[self container] imap4Login]; + return [container imap4Login]; } -- (NSString *)imap4Password { + +- (NSString *) imap4Password +{ /* Extract password from basic authentication. @@ -145,22 +178,8 @@ static BOOL debugOn = YES; a) move the primary code to SOGoMailAccount b) cache the password */ - WORequest *rq; - NSString *auth; - NSArray *creds; - - rq = [context request]; - if ((auth = [rq headerForKey:@"authorization"]) == nil) { - /* no basic auth */ - return nil; - } - - creds = [SoHTTPAuthenticator parseCredentials:auth]; - if ([creds count] < 2) - /* somehow invalid */ - return nil; - - return [creds objectAtIndex:1]; /* the password */ + + return [[self authenticatorInContext: context] passwordInContext: context]; } - (void)flushMailCaches { diff --git a/SoObjects/Mailer/SOGoMailBodyPart.m b/SoObjects/Mailer/SOGoMailBodyPart.m index ddad7dff..ec10200f 100644 --- a/SoObjects/Mailer/SOGoMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMailBodyPart.m @@ -29,17 +29,10 @@ static NSString *mailETag = nil; static BOOL debugOn = NO; -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { ++ (void) initialize +{ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - if (![[ud objectForKey:@"SOGoMailDisableETag"] boolValue]) { mailETag = [[NSString alloc] initWithFormat:@"\"imap4url_%d_%d_%03d\"", UIX_MAILER_MAJOR_VERSION, diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 68c74678..ab951bda 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -46,19 +46,10 @@ static NSString *defaultUserID = @"anyone"; static BOOL useAltNamespace = NO; -+ (int) version -{ - return [super version] + 0 /* v1 */; -} - + (void) initialize { NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - useAltNamespace = [ud boolForKey:@"SOGoSpecialFoldersInRoot"]; } @@ -111,7 +102,7 @@ static BOOL useAltNamespace = NO; - (NSString *) relativeImap4Name { - return [self nameInContainer]; + return nameInContainer; } /* listing the available folders */ @@ -269,10 +260,12 @@ static BOOL useAltNamespace = NO; /* check whether URL exists */ sf = [self imap4URL]; - sf = [NSURL URLWithString:[[sf path] stringByAppendingPathComponent:_key] - relativeToURL:sf]; + sf = [NSURL URLWithString: _key relativeToURL: sf]; + +// - sf = [NSURL URLWithString:[[sf path] stringByAppendingPathComponent:_key] +// - relativeToURL:sf]; - if (![[self imap4Connection] doesMailboxExistAtURL:sf]) { + if (![[self imap4Connection] doesMailboxExistAtURL: sf]) { /* We may not return 404, confuses path traversal - but we still do in the calling method. Probably the traversal process should be fixed to @@ -360,9 +353,11 @@ static BOOL useAltNamespace = NO; /* build IMAP4 URL for target */ destImapURL = [_target imap4URL]; - destImapURL = [NSURL URLWithString:[[destImapURL path] - stringByAppendingPathComponent:_name] - relativeToURL:destImapURL]; +// - destImapURL = [NSURL URLWithString:[[destImapURL path] +// - stringByAppendingPathComponent:_name] +// - relativeToURL:destImapURL]; + destImapURL = [NSURL URLWithString: _name + relativeToURL: destImapURL]; [self logWithFormat:@"TODO: should move collection as '%@' to: %@", [[self imap4URL] absoluteString], @@ -398,8 +393,8 @@ static BOOL useAltNamespace = NO; return folderType; account = [self mailAccountFolder]; - n = [self nameInContainer]; - + n = nameInContainer; + if ([n isEqualToString:[account trashFolderNameInContext:nil]]) folderType = @"IPF.Trash"; else if ([n isEqualToString:[account inboxFolderNameInContext:nil]]) diff --git a/SoObjects/Mailer/SOGoMailObject.h b/SoObjects/Mailer/SOGoMailObject.h index 7e46daad..72dae388 100644 --- a/SoObjects/Mailer/SOGoMailObject.h +++ b/SoObjects/Mailer/SOGoMailObject.h @@ -22,7 +22,7 @@ #ifndef __Mailer_SOGoMailObject_H__ #define __Mailer_SOGoMailObject_H__ -#include +#import /* SOGoMailObject diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 29c6a0ea..db704eb9 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -36,6 +36,7 @@ #import #import #import +#import #import #import #import @@ -60,17 +61,10 @@ static BOOL debugOn = NO; static BOOL debugBodyStructure = NO; static BOOL debugSoParts = NO; -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { ++ (void) initialize +{ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - if ((fetchHeader = ([ud boolForKey:@"SOGoDoNotFetchMailHeader"] ? NO : YES))) NSLog(@"Note: fetching full mail header."); else @@ -107,16 +101,27 @@ static BOOL debugSoParts = NO; } - (void)dealloc { - [self->headers release]; - [self->headerPart release]; - [self->coreInfos release]; + [headers release]; + [headerPart release]; + [coreInfos release]; [super dealloc]; } /* IMAP4 */ -- (NSString *)relativeImap4Name { - return [[self nameInContainer] stringByDeletingPathExtension]; +- (NSString *) relativeImap4Name +{ + return [nameInContainer stringByDeletingPathExtension]; +} + +- (NSMutableString *) imap4URLString +{ + NSMutableString *urlString; + + urlString = [container imap4URLString]; + [urlString appendFormat: @"%@", [nameInContainer stringByEscapingURL]]; + + return urlString; } /* hierarchy */ @@ -207,8 +212,8 @@ static BOOL debugSoParts = NO; static NSArray *existsKey = nil; id msgs; - if (self->coreInfos != nil) /* if we have coreinfos, we can use them */ - return [self->coreInfos isNotNull]; + if (coreInfos != nil) /* if we have coreinfos, we can use them */ + return [coreInfos isNotNull]; /* otherwise fetch something really simple */ @@ -223,8 +228,8 @@ static BOOL debugSoParts = NO; - (id)fetchCoreInfos { id msgs; - if (self->coreInfos != nil) - return [self->coreInfos isNotNull] ? self->coreInfos : nil; + if (coreInfos != nil) + return [coreInfos isNotNull] ? coreInfos : nil; #if 0 // TODO: old code, why was it using clientObject?? msgs = [[self clientObject] fetchParts:coreInfoKeys]; // returns dict @@ -236,8 +241,8 @@ static BOOL debugSoParts = NO; if ([msgs count] == 0) return nil; - self->coreInfos = [[msgs objectAtIndex:0] retain]; - return self->coreInfos; + coreInfos = [[msgs objectAtIndex:0] retain]; + return coreInfos; } - (id)bodyStructure { @@ -291,27 +296,30 @@ static BOOL debugSoParts = NO; NGMimeMessageParser *parser; NSData *data; - if (self->headerPart != nil) - return [self->headerPart isNotNull] ? self->headerPart : nil; + if (headerPart != nil) + return [headerPart isNotNull] ? headerPart : nil; if ([(data = [self mailHeaderData]) length] == 0) return nil; // TODO: do we need to set some delegate method which stops parsing the body? parser = [[NGMimeMessageParser alloc] init]; - self->headerPart = [[parser parsePartFromData:data] retain]; + headerPart = [[parser parsePartFromData:data] retain]; [parser release]; parser = nil; - if (self->headerPart == nil) { - self->headerPart = [[NSNull null] retain]; + if (headerPart == nil) { + headerPart = [[NSNull null] retain]; return nil; } - return self->headerPart; + return headerPart; } -- (NSDictionary *)mailHeaders { - if (self->headers == nil) - self->headers = [[[self mailHeaderPart] headers] copy]; - return self->headers; + +- (NSDictionary *) mailHeaders +{ + if (!headers) + headers = [[[self mailHeaderPart] headers] copy]; + + return headers; } - (id)lookupInfoForBodyPart:(id)_path { diff --git a/SoObjects/Mailer/SOGoMessageMailBodyPart.m b/SoObjects/Mailer/SOGoMessageMailBodyPart.m index 32e2da9a..4932bf20 100644 --- a/SoObjects/Mailer/SOGoMessageMailBodyPart.m +++ b/SoObjects/Mailer/SOGoMessageMailBodyPart.m @@ -42,14 +42,4 @@ @implementation SOGoMessageMailBodyPart -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} - @end /* SOGoMessageMailBodyPart */ diff --git a/SoObjects/Mailer/SOGoSharedInboxFolder.m b/SoObjects/Mailer/SOGoSharedInboxFolder.m index 85a98f47..d5e444bf 100644 --- a/SoObjects/Mailer/SOGoSharedInboxFolder.m +++ b/SoObjects/Mailer/SOGoSharedInboxFolder.m @@ -24,16 +24,6 @@ @implementation SOGoSharedInboxFolder -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} - /* listing available folders */ - (NSArray *)toManyRelationshipKeys { diff --git a/SoObjects/Mailer/SOGoSharedMailAccount.m b/SoObjects/Mailer/SOGoSharedMailAccount.m index 27326638..5b7ba9ec 100644 --- a/SoObjects/Mailer/SOGoSharedMailAccount.m +++ b/SoObjects/Mailer/SOGoSharedMailAccount.m @@ -35,17 +35,10 @@ static NSString *otherUsersFolderName = @""; // TODO: add English default -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { ++ (void) initialize +{ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); - otherUsersFolderName = [ud stringForKey:@"SOGoOtherUsersFolderName"]; NSLog(@"Note: using other-users-folders name: '%@'", otherUsersFolderName); } diff --git a/SoObjects/Mailer/SOGoVCardMailBodyPart.m b/SoObjects/Mailer/SOGoVCardMailBodyPart.m index 13ce2231..3f24d21a 100644 --- a/SoObjects/Mailer/SOGoVCardMailBodyPart.m +++ b/SoObjects/Mailer/SOGoVCardMailBodyPart.m @@ -40,14 +40,4 @@ @implementation SOGoVCardMailBodyPart -+ (int)version { - return [super version] + 0 /* v1 */; -} - -+ (void)initialize { - NSAssert2([super version] == 1, - @"invalid superclass (%@) version %i !", - NSStringFromClass([self superclass]), [super version]); -} - @end /* SOGoVCardMailBodyPart */ diff --git a/SoObjects/Mailer/common.h b/SoObjects/Mailer/common.h index c694a6dc..634e72eb 100644 --- a/SoObjects/Mailer/common.h +++ b/SoObjects/Mailer/common.h @@ -36,3 +36,5 @@ #include #include + +#warning importing common.h is baaad diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 640c057d..6a93540d 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -69,7 +69,8 @@ static NSMutableCharacterSet *urlAfterEndingChars = nil; hostR = [self rangeOfString: @"://"]; locationR = [[self substringFromIndex: (hostR.location + hostR.length)] rangeOfString: @"/"]; - newURL = [self substringFromIndex: (hostR.location + hostR.length + locationR.location)]; + newURL = [self substringFromIndex: (hostR.location + hostR.length + + locationR.location)]; } return newURL; diff --git a/SoObjects/SOGo/SOGoAuthenticator.h b/SoObjects/SOGo/SOGoAuthenticator.h index 3ada0735..6f8cd5fe 100644 --- a/SoObjects/SOGo/SOGoAuthenticator.h +++ b/SoObjects/SOGo/SOGoAuthenticator.h @@ -44,6 +44,7 @@ + (id) sharedSOGoAuthenticator; - (SOGoUser *) userInContext: (WOContext *) _ctx; +- (NSString *) passwordInContext: (WOContext *) context; @end diff --git a/SoObjects/SOGo/SOGoAuthenticator.m b/SoObjects/SOGo/SOGoAuthenticator.m index cb67ba4c..edf368fb 100644 --- a/SoObjects/SOGo/SOGoAuthenticator.m +++ b/SoObjects/SOGo/SOGoAuthenticator.m @@ -82,7 +82,7 @@ // && [_pwd isEqualToString: @"freebusy"])); } -- (NSString *) _passwordInContext: (WOContext *) context +- (NSString *) passwordInContext: (WOContext *) context { NSString *auth, *password; NSArray *creds; @@ -95,7 +95,7 @@ if ([creds count] > 1) password = [creds objectAtIndex: 1]; } - + return password; } @@ -125,7 +125,7 @@ { user = [SOGoUser userWithLogin: login roles: [self rolesForLogin: login]]; - [user setCurrentPassword: [self _passwordInContext: _ctx]]; + [user setCurrentPassword: [self passwordInContext: _ctx]]; } } else diff --git a/SoObjects/Sieve/common.h b/SoObjects/Sieve/common.h index bf5ab285..3c76bc13 100644 --- a/SoObjects/Sieve/common.h +++ b/SoObjects/Sieve/common.h @@ -32,3 +32,5 @@ #include #include + +#warning importing common.h is baaad diff --git a/UI/Common/common.h b/UI/Common/common.h index ea759a93..803270d7 100644 --- a/UI/Common/common.h +++ b/UI/Common/common.h @@ -22,6 +22,8 @@ #import +#warning importing common.h is baaad + #if LIB_FOUNDATION_LIBRARY # include #elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY diff --git a/UI/Contacts/common.h b/UI/Contacts/common.h index bb109a4a..6443479d 100644 --- a/UI/Contacts/common.h +++ b/UI/Contacts/common.h @@ -32,3 +32,5 @@ #include #include #include + +#warning importing common.h is baaad diff --git a/UI/MailPartViewers/common.h b/UI/MailPartViewers/common.h index 9e98639c..6cda6842 100644 --- a/UI/MailPartViewers/common.h +++ b/UI/MailPartViewers/common.h @@ -31,3 +31,5 @@ #include #include #include + +#warning importing common.h is baaad diff --git a/UI/MailerUI/common.h b/UI/MailerUI/common.h index ca5c2267..4906cbae 100644 --- a/UI/MailerUI/common.h +++ b/UI/MailerUI/common.h @@ -32,3 +32,5 @@ #include #include #include + +#warning importing common.h is baaad diff --git a/UI/MainUI/common.h b/UI/MainUI/common.h index ea6a4dbf..24b5c03e 100644 --- a/UI/MainUI/common.h +++ b/UI/MainUI/common.h @@ -32,3 +32,5 @@ #include #include + +#warning importing common.h is baaad diff --git a/UI/SOGoUI/common.h b/UI/SOGoUI/common.h index 4a433df2..56a455ce 100644 --- a/UI/SOGoUI/common.h +++ b/UI/SOGoUI/common.h @@ -24,3 +24,5 @@ #include #include + +#warning importing common.h is baaad diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index c2764a39..d2c2a342 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -373,8 +373,14 @@ if (hasStartDate) [todo setStartDate: taskStartDate]; + else + [todo setStartDate: nil]; + if (hasDueDate) [todo setDue: taskDueDate]; + else + [todo setDue: nil]; + if ([status isEqualToString: @"COMPLETED"]) [todo setCompleted: statusDate]; else diff --git a/UI/Scheduler/common.h b/UI/Scheduler/common.h index 5f7079c0..f8c223d5 100644 --- a/UI/Scheduler/common.h +++ b/UI/Scheduler/common.h @@ -32,3 +32,5 @@ #import #import #import + +#warning importing common.h is baaad diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 3c7c91fe..860d0e57 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -250,21 +250,21 @@ function onDaySelect(node) { return false; } -function onDateSelectorGotoMonth(node) { - var day = node.getAttribute("date"); +function onDateSelectorGotoMonth(event) { + var day = this.getAttribute("date"); - changeDateSelectorDisplay(day, true); + changeDateSelectorDisplay(day, true); - return false; + Event.stop(event); } function onCalendarGotoDay(node) { - var day = node.getAttribute("date"); - - changeDateSelectorDisplay(day); - changeCalendarDisplay( { "day": day } ); - - return false; + var day = node.getAttribute("date"); + + changeDateSelectorDisplay(day); + changeCalendarDisplay( { "day": day } ); + + return false; } function gotoToday() { @@ -280,6 +280,8 @@ function setDateSelectorContent(content) { div.innerHTML = content; if (currentDay.length > 0) restoreCurrentDaySelection(div); + + initDateSelectorEvents(); } function dateSelectorCallback(http) { @@ -289,7 +291,6 @@ function dateSelectorCallback(http) { var content = http.responseText; setDateSelectorContent(content); cachedDateSelectors[http.callbackData] = content; - initDateSelectorEvents(); } else log ("dateSelectorCallback Ajax error"); diff --git a/UI/WebServerResources/UIxTaskEditor.js b/UI/WebServerResources/UIxTaskEditor.js index 7c67eb7b..b68d3dac 100644 --- a/UI/WebServerResources/UIxTaskEditor.js +++ b/UI/WebServerResources/UIxTaskEditor.js @@ -1,7 +1,5 @@ var contactSelectorAction = 'calendars-contacts'; -addEvent(window, 'DOMContentLoaded', onTaskEditorLoad); - function uixEarlierDate(date1, date2) { // can this be done in a sane way? // cuicui = 'year'; @@ -294,3 +292,5 @@ function initializeStatusLine() { function onTaskEditorLoad() { initializeStatusLine(); } + +addEvent(window, 'load', onTaskEditorLoad);