+2007-07-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * 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 <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
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:
02111-1307, USA.
*/
+#import <Foundation/NSArray.h>
+#import <Foundation/NSDictionary.h>
+#import <NGExtensions/NSObject+Logs.h>
+
#import <GDLContentStore/GCSFieldExtractor.h>
#import <NGCards/NGVCard.h>
-#import "common.h"
@interface OCSContactFieldExtractor : GCSFieldExtractor
@end
02111-1307, USA.
*/
-#include "OCSiCalFieldExtractor.h"
-#include "common.h"
-#include <NGCards/NGCards.h>
-#include "iCalEntityObject+OCS.h"
-#include "iCalRepeatableEntityObject+OCS.h"
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSNull.h>
+#import <Foundation/NSString.h>
+#import <Foundation/NSValue.h>
+
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
+
+#import "iCalEntityObject+OCS.h"
+#import "iCalRepeatableEntityObject+OCS.h"
+
+#import "OCSiCalFieldExtractor.h"
@implementation OCSiCalFieldExtractor
[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"];
}
- (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;
else
[self logWithFormat: @"ERROR: parsing source didn't return anything"];
- [pool release];
-
return [fields autorelease];
}
+++ /dev/null
-/*
- 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 <Foundation/Foundation.h>
-#import <Foundation/NSURL.h>
-
-#include <NGExtensions/NGExtensions.h>
-
-#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
02111-1307, USA.
*/
-#include "iCalEntityObject+OCS.h"
-#include "common.h"
+#import "iCalEntityObject+OCS.h"
@implementation iCalEntityObject (OCS)
02111-1307, USA.
*/
-#include "iCalRepeatableEntityObject+OCS.h"
-#include "common.h"
+#import <Foundation/NSArray.h>
+#import <Foundation/NSDictionary.h>
+
+#import "iCalRepeatableEntityObject+OCS.h"
@implementation iCalRepeatableEntityObject (OCS)
*/
+#import <Foundation/NSArray.h>
+#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSObject.h>
+#import <Foundation/NSProcessInfo.h>
+#import <Foundation/NSString.h>
-@class NSArray;
+#import <NGExtensions/NSProcessInfo+misc.h>
+
+#import <GDLContentStore/GCSFieldExtractor.h>
@interface TestQuickExtract : NSObject
@end
-#include <GDLContentStore/GCSFieldExtractor.h>
-#include "common.h"
-
@implementation TestQuickExtract
- (int)usage:(NSArray *)_args {
+2007-07-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * iCalToDo.m ([iCalToDo -setDue:newDueDate]): use setDateTime:
+ instead of setDate: because the latter sets an "all day"
+ timestamp.
+
2007-07-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalRecurrenceRule.m ([iCalRecurrenceRule
- (void) setDue: (NSCalendarDate *) newDueDate
{
[(iCalDateTime *) [self uniqueChildWithTag: @"due"]
- setDate: newDueDate];
+ setDateTime: newDueDate];
}
- (NSCalendarDate *) due
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+#warning importing common.h is baaad
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#import <Foundation/NSObject.h>
@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 */
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"];
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/";
@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 */
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"];
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];
}
// 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;
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;
reason:@"did not find Trash folder!"];
}
- return ((self->trashFolder = [folder retain]));
+ return ((trashFolder = [folder retain]));
}
/* WebDAV */
02111-1307, USA.
*/
-#include "SOGoMailBaseObject.h"
-#include "SOGoMailManager.h"
-#include "common.h"
-#include <NGObjWeb/SoObject+SoDAV.h>
-#include <NGObjWeb/SoHTTPAuthenticator.h>
-#include <NGExtensions/NSURL+misc.h>
+#import <NGObjWeb/SoObject+SoDAV.h>
+#import <NGObjWeb/SoHTTPAuthenticator.h>
+#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
+#import <NGExtensions/NSString+misc.h>
+#import <NGExtensions/NSURL+misc.h>
-@implementation SOGoMailBaseObject
+#import <SoObjects/SOGo/SOGoAuthenticator.h>
-+ (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.
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 {
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,
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"];
}
- (NSString *) relativeImap4Name
{
- return [self nameInContainer];
+ return nameInContainer;
}
/* listing the available folders */
/* 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
/* 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],
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]])
#ifndef __Mailer_SOGoMailObject_H__
#define __Mailer_SOGoMailObject_H__
-#include <SoObjects/Mailer/SOGoMailBaseObject.h>
+#import <SoObjects/Mailer/SOGoMailBaseObject.h>
/*
SOGoMailObject
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import <NGExtensions/NSString+Encoding.h>
+#import <NGExtensions/NSString+misc.h>
#import <NGImap4/NGImap4Connection.h>
#import <NGImap4/NGImap4Envelope.h>
#import <NGImap4/NGImap4EnvelopeAddress.h>
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
}
- (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 */
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 */
- (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
if ([msgs count] == 0)
return nil;
- self->coreInfos = [[msgs objectAtIndex:0] retain];
- return self->coreInfos;
+ coreInfos = [[msgs objectAtIndex:0] retain];
+ return coreInfos;
}
- (id)bodyStructure {
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 {
@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 */
@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 {
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);
}
@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 */
#include <NGObjWeb/SoObject+SoDAV.h>
#include <NGImap4/NGImap4Connection.h>
+
+#warning importing common.h is baaad
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;
+ (id) sharedSOGoAuthenticator;
- (SOGoUser *) userInContext: (WOContext *) _ctx;
+- (NSString *) passwordInContext: (WOContext *) context;
@end
// && [_pwd isEqualToString: @"freebusy"]));
}
-- (NSString *) _passwordInContext: (WOContext *) context
+- (NSString *) passwordInContext: (WOContext *) context
{
NSString *auth, *password;
NSArray *creds;
if ([creds count] > 1)
password = [creds objectAtIndex: 1];
}
-
+
return password;
}
{
user = [SOGoUser userWithLogin: login
roles: [self rolesForLogin: login]];
- [user setCurrentPassword: [self _passwordInContext: _ctx]];
+ [user setCurrentPassword: [self passwordInContext: _ctx]];
}
}
else
#include <NGObjWeb/SoObjects.h>
#include <NGImap4/NGImap4Client.h>
+
+#warning importing common.h is baaad
#import <Foundation/Foundation.h>
+#warning importing common.h is baaad
+
#if LIB_FOUNDATION_LIBRARY
# include <Foundation/exceptions/GeneralExceptions.h>
#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
#include <NGObjWeb/SoObjects.h>
#include <GDLAccess/GDLAccess.h>
+
+#warning importing common.h is baaad
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
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
#import <NGExtensions/NGExtensions.h>
#import <NGObjWeb/NGObjWeb.h>
#import <NGObjWeb/SoObjects.h>
+
+#warning importing common.h is baaad
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() {
div.innerHTML = content;
if (currentDay.length > 0)
restoreCurrentDaySelection(div);
+
+ initDateSelectorEvents();
}
function dateSelectorCallback(http) {
var content = http.responseText;
setDateSelectorContent(content);
cachedDateSelectors[http.callbackData] = content;
- initDateSelectorEvents();
}
else
log ("dateSelectorCallback Ajax error");
var contactSelectorAction = 'calendars-contacts';
-addEvent(window, 'DOMContentLoaded', onTaskEditorLoad);
-
function uixEarlierDate(date1, date2) {
// can this be done in a sane way?
// cuicui = 'year';
function onTaskEditorLoad() {
initializeStatusLine();
}
+
+addEvent(window, 'load', onTaskEditorLoad);