Monotone-Parent: 98f0464d1da2b872d5573c46ffb4cba64b5f1e50

Monotone-Revision: 7c7a8b7547ec7b4ed3b19f65785d05cc377b5a57

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-08-01T18:22:45
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-08-01 18:22:45 +00:00
parent fa475ac991
commit 7caa393ed8
16 changed files with 182 additions and 160 deletions

View File

@@ -19,7 +19,7 @@
02111-1307, USA.
*/
#include <Mailer/SOGoMailBodyPart.h>
#import "SOGoMailBodyPart.h"
/*
SOGoCalendarMailBodyPart
@@ -31,13 +31,8 @@
*/
@interface SOGoCalendarMailBodyPart : SOGoMailBodyPart
{
}
@end
#include "common.h"
@implementation SOGoCalendarMailBodyPart
@end /* SOGoCalendarMailBodyPart */

View File

@@ -19,35 +19,51 @@
02111-1307, USA.
*/
#include "SOGoDraftsFolder.h"
#include "SOGoDraftObject.h"
#include <SOGo/SOGoUserFolder.h>
#include <NGExtensions/NSFileManager+Extensions.h>
#include "common.h"
#include <unistd.h>
#import <unistd.h>
#import <Foundation/NSArray.h>
#import <Foundation/NSUserDefaults.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGExtensions/NSFileManager+Extensions.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SoObjects/SOGo/SOGoUserFolder.h>
#import "SOGoDraftObject.h"
#import "SOGoDraftsFolder.h"
@implementation SOGoDraftsFolder
static NSString *spoolFolder = nil;
+ (void)initialize {
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+ (void) initialize
{
NSUserDefaults *ud;;
spoolFolder = [[ud stringForKey:@"SOGoMailSpoolPath"] copy];
if ([spoolFolder length] < 3)
spoolFolder = @"/tmp/";
NSLog(@"Note: using SOGo mail spool folder: %@", spoolFolder);
if (!spoolFolder)
{
ud = [NSUserDefaults standardUserDefaults];
spoolFolder = [[ud stringForKey:@"SOGoMailSpoolPath"] copy];
if ([spoolFolder length] < 3)
spoolFolder = @"/tmp/";
NSLog(@"Note: using SOGo mail spool folder: %@", spoolFolder);
}
}
/* new objects */
- (NSString *)makeNewObjectNameInContext:(id)_ctx {
- (NSString *) makeNewObjectNameInContext: (id) _ctx
{
static int counter = 1; // THREAD
return [NSString stringWithFormat:@"draft_%08d_%08x", getpid(), counter++];
}
- (NSString *)newObjectBaseURLInContext:(id)_ctx {
- (NSString *) newObjectBaseURLInContext: (id) _ctx
{
NSString *s, *n;
n = [self makeNewObjectNameInContext:_ctx];
@@ -59,29 +75,36 @@ static NSString *spoolFolder = nil;
return [s stringByAppendingString:n];
}
- (id)newObjectInContext:(id)_ctx {
- (id) newObjectInContext: (id) _ctx
{
return [self lookupName:[self makeNewObjectNameInContext:_ctx]
inContext:_ctx acquire:NO];
}
/* draft folder functionality */
- (NSFileManager *)spoolFileManager {
- (NSFileManager *) spoolFileManager
{
return [NSFileManager defaultManager];
}
- (NSString *)spoolFolderPath {
- (NSString *) spoolFolderPath
{
return spoolFolder;
}
- (NSString *)userSpoolFolderPath {
- (NSString *) userSpoolFolderPath
{
NSString *p, *n;
p = [self spoolFolderPath];
n = [[self lookupUserFolder] nameInContainer];
return [p stringByAppendingPathComponent:n];
}
- (BOOL)_ensureUserSpoolFolderPath {
- (BOOL) _ensureUserSpoolFolderPath
{
NSFileManager *fm;
if ((fm = [self spoolFileManager]) == nil) {
@@ -92,7 +115,8 @@ static NSString *spoolFolder = nil;
attributes:nil];
}
- (NSArray *)fetchMailNames {
- (NSArray *) fetchMailNames
{
NSString *p;
if ((p = [self userSpoolFolderPath]) == nil)
@@ -103,7 +127,9 @@ static NSString *spoolFolder = nil;
/* folder methods (used by template) */
- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so {
- (NSArray *) fetchUIDsMatchingQualifier: (id) _q
sortOrdering: (id) _so
{
// TODO: retrieve contained objects
NSArray *allUids;
@@ -117,7 +143,7 @@ static NSString *spoolFolder = nil;
// TODO: should sort uids (q=%@,so=%@): %@", _q, _so, allUids];
return allUids;
}
- (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts {
- (NSArray *)fetchUIDs: (NSArray *)_uids parts: (NSArray *)_parts {
/* FLAGS, ENVELOPE, RFC822.SIZE */
NSMutableArray *drafts;
unsigned i, count;
@@ -146,13 +172,18 @@ static NSString *spoolFolder = nil;
/* name lookup */
- (id)lookupDraftMessage:(NSString *)_key inContext:(id)_ctx {
- (id) lookupDraftMessage: (NSString *) _key
inContext: (id) _ctx
{
// TODO: we might want to check for existence prior controller creation
return [[[SOGoDraftObject alloc] initWithName:_key
inContainer:self] autorelease];
}
- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
- (id) lookupName: (NSString *) _key
inContext: (id) _ctx
acquire: (BOOL) _flag
{
id obj;
/* first check attributes directly bound to the application */
@@ -168,17 +199,20 @@ static NSString *spoolFolder = nil;
/* WebDAV */
- (BOOL)davIsCollection {
- (BOOL) davIsCollection
{
return YES;
}
- (NSArray *)toOneRelationshipKeys {
- (NSArray *) toOneRelationshipKeys
{
return [self fetchMailNames];
}
/* folder type */
- (NSString *)outlookFolderClass {
- (NSString *) outlookFolderClass
{
return @"IPF.Drafts";
}

View File

@@ -19,7 +19,7 @@
02111-1307, USA.
*/
#include <Mailer/SOGoMailBodyPart.h>
#import "SOGoMailBodyPart.h"
/*
SOGoImageMailBodyPart
@@ -36,8 +36,6 @@
@end
#include "common.h"
@implementation SOGoImageMailBodyPart
@end /* SOGoImageMailBodyPart */

View File

@@ -19,10 +19,16 @@
02111-1307, USA.
*/
#include "SOGoMailAccounts.h"
#include "SOGoUser+Mail.h"
#include "common.h"
#include <NGObjWeb/SoObject+SoDAV.h>
#import <Foundation/NSString.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/WOContext+SoObjects.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import "SOGoUser+Mail.h"
#import "SOGoMailAccounts.h"
@implementation SOGoMailAccounts
@@ -38,7 +44,7 @@ static NSString *AgenorShareLoginMarker = @".-.";
- (NSArray *)toManyRelationshipKeys {
SOGoUser *user;
id account;
NSArray *shares;
// NSArray *shares;
NSString *userLogin;
/*
@@ -63,11 +69,12 @@ static NSString *AgenorShareLoginMarker = @".-.";
account = [user primaryIMAP4AccountString];
if ([account isNotNull]) account = [NSArray arrayWithObject:account];
shares = [user valueForKey:@"additionalIMAP4AccountStrings"];
return ([shares count] == 0)
? account
: [account arrayByAddingObjectsFromArray:shares];
return account;
// shares = [user valueForKey:@"additionalIMAP4AccountStrings"]
// return ([shares count] == 0)
// ? account
// : [account arrayByAddingObjectsFromArray:shares];
}
- (NSArray *) fetchIdentitiesWithOnlyEmitterAccess: (BOOL) _flag

View File

@@ -19,10 +19,25 @@
02111-1307, USA.
*/
#include "SOGoMailBodyPart.h"
#include "SOGoMailObject.h"
#include "SOGoMailManager.h"
#include "common.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSDictionary.h>
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WOResponse.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NGBase64Coding.h>
#import <NGImap4/NGImap4Connection.h>
#import "SOGoMailObject.h"
#import "SOGoMailManager.h"
#import "SOGoMailBodyPart.h"
@implementation SOGoMailBodyPart

View File

@@ -19,11 +19,21 @@
02111-1307, USA.
*/
#include "SOGoMailFolderDataSource.h"
#include "SOGoMailManager.h"
#include <NGObjWeb/EOFetchSpecification+SoDAV.h>
#include <NGImap4/NGImap4Envelope.h>
#include "common.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSAutoreleasePool.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <NGObjWeb/EOFetchSpecification+SoDAV.h>
#import <NGExtensions/EODataSource+NGExtensions.h>
#import <NGExtensions/NSObject+Logs.h>
#import <EOControl/EOQualifier.h>
#import <EOControl/EOSortOrdering.h>
#import <NGImap4/NGImap4Envelope.h>
#import "SOGoMailManager.h"
#import "SOGoMailFolderDataSource.h"
@implementation SOGoMailFolderDataSource

View File

@@ -19,101 +19,104 @@
02111-1307, USA.
*/
#include "SOGoMailIdentity.h"
#include "common.h"
#import <Foundation/NSString.h>
#import <NGExtensions/NSNull+misc.h>
#import "SOGoMailIdentity.h"
@implementation SOGoMailIdentity
- (void)dealloc {
[self->name release];
[self->email release];
[self->replyTo release];
[self->organization release];
[self->signature release];
[self->vCard release];
[self->sentFolderName release];
[self->sentBCC release];
[self->draftsFolderName release];
[self->templatesFolderName release];
[name release];
[email release];
[replyTo release];
[organization release];
[signature release];
[vCard release];
[sentFolderName release];
[sentBCC release];
[draftsFolderName release];
[templatesFolderName release];
[super dealloc];
}
/* accessors */
- (void)setName:(NSString *)_value {
ASSIGNCOPY(self->name, _value);
ASSIGNCOPY(name, _value);
}
- (NSString *)name {
return self->name;
return name;
}
- (void)setEmail:(NSString *)_value {
ASSIGNCOPY(self->email, _value);
ASSIGNCOPY(email, _value);
}
- (NSString *)email {
return self->email;
return email;
}
- (void)setReplyTo:(NSString *)_value {
ASSIGNCOPY(self->replyTo, _value);
ASSIGNCOPY(replyTo, _value);
}
- (NSString *)replyTo {
return self->replyTo;
return replyTo;
}
- (void)setOrganization:(NSString *)_value {
ASSIGNCOPY(self->organization, _value);
ASSIGNCOPY(organization, _value);
}
- (NSString *)organization {
return self->organization;
return organization;
}
- (void)setSignature:(NSString *)_value {
ASSIGNCOPY(self->signature, _value);
ASSIGNCOPY(signature, _value);
}
- (NSString *)signature {
return self->signature;
return signature;
}
- (BOOL)hasSignature {
return [[self signature] isNotEmpty];
}
- (void)setVCard:(NSString *)_value {
ASSIGNCOPY(self->vCard, _value);
ASSIGNCOPY(vCard, _value);
}
- (NSString *)vCard {
return self->vCard;
return vCard;
}
- (BOOL)hasVCard {
return [[self vCard] isNotEmpty];
}
- (void)setSentFolderName:(NSString *)_value {
ASSIGNCOPY(self->sentFolderName, _value);
ASSIGNCOPY(sentFolderName, _value);
}
- (NSString *)sentFolderName {
return self->sentFolderName;
return sentFolderName;
}
- (void)setSentBCC:(NSString *)_value {
ASSIGNCOPY(self->sentBCC, _value);
ASSIGNCOPY(sentBCC, _value);
}
- (NSString *)sentBCC {
return self->sentBCC;
return sentBCC;
}
- (void)setDraftsFolderName:(NSString *)_value {
ASSIGNCOPY(self->draftsFolderName, _value);
ASSIGNCOPY(draftsFolderName, _value);
}
- (NSString *)draftsFolderName {
return self->draftsFolderName;
return draftsFolderName;
}
- (void)setTemplatesFolderName:(NSString *)_value {
ASSIGNCOPY(self->templatesFolderName, _value);
ASSIGNCOPY(templatesFolderName, _value);
}
- (NSString *)templatesFolderName {
return self->templatesFolderName;
return templatesFolderName;
}
/* description */
@@ -124,14 +127,14 @@
ms = [NSMutableString stringWithCapacity:128];
[ms appendFormat:@"<0x%08X[%@]:", self, NSStringFromClass([self class])];
if (self->name != nil) [ms appendFormat:@" name='%@'", self->name];
if (self->email != nil) [ms appendFormat:@" email='%@'", self->email];
if (name != nil) [ms appendFormat:@" name='%@'", name];
if (email != nil) [ms appendFormat:@" email='%@'", email];
if (self->sentFolderName != nil)
[ms appendFormat:@" sent='%@'", self->sentFolderName];
if (sentFolderName != nil)
[ms appendFormat:@" sent='%@'", sentFolderName];
if ([self->sentBCC length] > 0) [ms appendString:@" sent-bcc"];
if ([self->vCard length] > 0) [ms appendString:@" vcard"];
if ([sentBCC length] > 0) [ms appendString:@" sent-bcc"];
if ([vCard length] > 0) [ms appendString:@" vcard"];
[ms appendString:@">"];
return ms;

View File

@@ -19,10 +19,14 @@
02111-1307, USA.
*/
#include "SOGoMailManager.h"
#include <NGImap4/NGImap4Connection.h>
#include <NGImap4/NGImap4ConnectionManager.h>
#include "common.h"
#import <Foundation/NSArray.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGImap4/NGImap4Connection.h>
#import <NGImap4/NGImap4ConnectionManager.h>
#import "SOGoMailManager.h"
/*
Could check read-write state:

View File

@@ -19,7 +19,7 @@
02111-1307, USA.
*/
#include <Mailer/SOGoMailBodyPart.h>
#import "SOGoMailBodyPart.h"
/*
SOGoMessageMailBodyPart
@@ -33,13 +33,8 @@
*/
@interface SOGoMessageMailBodyPart : SOGoMailBodyPart
{
}
@end
#include "common.h"
@implementation SOGoMessageMailBodyPart
@end /* SOGoMessageMailBodyPart */

View File

@@ -22,7 +22,7 @@
#ifndef __Mailer_SOGoSharedInboxFolder_H__
#define __Mailer_SOGoSharedInboxFolder_H__
#include <SoObjects/Mailer/SOGoMailFolder.h>
#import <SoObjects/Mailer/SOGoMailFolder.h>
/*
SOGoSharedInboxFolder

View File

@@ -19,8 +19,7 @@
02111-1307, USA.
*/
#include "SOGoSharedInboxFolder.h"
#include "common.h"
#import "SOGoSharedInboxFolder.h"
@implementation SOGoSharedInboxFolder

View File

@@ -22,7 +22,7 @@
#ifndef __Mailer_SOGoTrashFolder_H__
#define __Mailer_SOGoTrashFolder_H__
#include <SoObjects/Mailer/SOGoMailFolder.h>
#import "SOGoMailFolder.h"
@interface SOGoTrashFolder : SOGoMailFolder
@end

View File

@@ -19,8 +19,9 @@
02111-1307, USA.
*/
#include "SOGoTrashFolder.h"
#include "common.h"
#import <Foundation/NSString.h>
#import "SOGoTrashFolder.h"
@implementation SOGoTrashFolder

View File

@@ -19,9 +19,16 @@
02111-1307, USA.
*/
#include "SOGoUser+Mail.h"
#include "SOGoMailIdentity.h"
#include "common.h"
#import <Foundation/NSArray.h>
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSKeyValueCoding.h>
#import <NGExtensions/NSNull+misc.h>
#import <NGExtensions/NSObject+Logs.h>
#import "SOGoMailIdentity.h"
#import "SOGoUser+Mail.h"
@implementation SOGoUser(Mail)

View File

@@ -19,7 +19,7 @@
02111-1307, USA.
*/
#include <Mailer/SOGoMailBodyPart.h>
#import "SOGoMailBodyPart.h"
/*
SOGoVCardMailBodyPart
@@ -31,13 +31,7 @@
*/
@interface SOGoVCardMailBodyPart : SOGoMailBodyPart
{
}
@end
#include "common.h"
@implementation SOGoVCardMailBodyPart
@end /* SOGoVCardMailBodyPart */

View File

@@ -1,40 +0,0 @@
/*
Copyright (C) 2002-2005 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.
*/
#warning importing common is baaad
#import <Foundation/Foundation.h>
#import <Foundation/NSObjCRuntime.h>
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
# include <NGExtensions/NGObjectMacros.h>
# include <NGExtensions/NSString+Ext.h>
#endif
#include <NGExtensions/NGExtensions.h>
#include <NGObjWeb/NGObjWeb.h>
#include <NGObjWeb/SoObjects.h>
#include <NGObjWeb/SoObject+SoDAV.h>
#include <NGImap4/NGImap4Connection.h>
#warning importing common.h is baaad