Monotone-Parent: f6829bdd7a8f8207d69f2c7bd6e1dc52fe733eb0

Monotone-Revision: 2d07c11d93d913a43469f1241e1bd63bece15be7

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-04T15:58:52
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau 2010-01-04 15:58:52 +00:00
parent 0a187f9d38
commit b8fafe42da
9 changed files with 92 additions and 25 deletions

View file

@ -1,3 +1,10 @@
2010-01-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailForward.m (-): we use
-[SOGoUserDefaults mailComposeMessageType] instead of querying the
defaults key, so that the fallbacking mechanism between the
different preference layers can be used.
2009-12-26 Ludovic Marcotte <lmarcotte@inverse.ca> 2009-12-26 Ludovic Marcotte <lmarcotte@inverse.ca>
* SoObjects/SOGo/SOGoMailer.m (_smtpSendData: * SoObjects/SOGo/SOGoMailer.m (_smtpSendData:

View file

@ -55,6 +55,7 @@ typedef enum {
SOGoSentFolder *sentFolder; SOGoSentFolder *sentFolder;
SOGoTrashFolder *trashFolder; SOGoTrashFolder *trashFolder;
SOGoIMAPAclStyle imapAclStyle; SOGoIMAPAclStyle imapAclStyle;
NSMutableArray *namespaces;
} }
- (void) setAccountName: (NSString *) newAccountName; - (void) setAccountName: (NSString *) newAccountName;

View file

@ -39,6 +39,7 @@
#import <NGImap4/NGSieveClient.h> #import <NGImap4/NGSieveClient.h>
#import <SOGo/NSArray+Utilities.h> #import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoDomainDefaults.h> #import <SOGo/SOGoDomainDefaults.h>
#import <SOGo/SOGoUser.h> #import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserDefaults.h> #import <SOGo/SOGoUserDefaults.h>
@ -67,6 +68,7 @@ static NSString *sieveScriptName = @"sogo";
trashFolder = nil; trashFolder = nil;
accountName = nil; accountName = nil;
imapAclStyle = undefined; imapAclStyle = undefined;
namespaces = nil;
} }
return self; return self;
@ -74,6 +76,7 @@ static NSString *sieveScriptName = @"sogo";
- (void) dealloc - (void) dealloc
{ {
[namespaces release];
[inboxFolder release]; [inboxFolder release];
[draftsFolder release]; [draftsFolder release];
[sentFolder release]; [sentFolder release];
@ -94,23 +97,54 @@ static NSString *sieveScriptName = @"sogo";
return NO; return NO;
} }
- (void) _appendNamespace: (NSArray *) namespace
toFolders: (NSMutableArray *) folders
{
NSString *newFolder;
NSDictionary *currentPart;
int count, max;
max = [namespace count];
for (count = 0; count < max; count++)
{
currentPart = [namespace objectAtIndex: count];
newFolder
= [[currentPart objectForKey: @"prefix"] substringFromIndex: 1];
if ([newFolder length])
[folders addObject: [newFolder asCSSIdentifier]];
}
}
- (void) _appendNamespaces: (NSMutableArray *) folders
{
NSDictionary *namespaceDict;
NSArray *namespace;
NGImap4Client *client;
client = [[self imap4Connection] client];
namespaceDict = [client namespace];
namespace = [namespaceDict objectForKey: @"personal"];
if (namespace)
[self _appendNamespace: namespace toFolders: folders];
namespace = [namespaceDict objectForKey: @"other users"];
if (namespace)
[self _appendNamespace: namespace toFolders: folders];
namespace = [namespaceDict objectForKey: @"shared"];
if (namespace)
[self _appendNamespace: namespace toFolders: folders];
}
- (NSArray *) toManyRelationshipKeys - (NSArray *) toManyRelationshipKeys
{ {
NSMutableArray *folders; NSMutableArray *folders;
NSArray *imapFolders, *additionalFolders; NSArray *imapFolders;
folders = [NSMutableArray array];
imapFolders = [[self imap4Connection] subfoldersForURL: [self imap4URL]]; imapFolders = [[self imap4Connection] subfoldersForURL: [self imap4URL]];
additionalFolders folders = [imapFolders mutableCopy];
= [NSArray arrayWithObject: [self draftsFolderNameInContext: nil]]; [folders autorelease];
if ([imapFolders count] > 0) [folders addObjectUniquely: [self draftsFolderNameInContext: nil]];
[folders addObjectsFromArray: imapFolders];
if ([additionalFolders count] > 0) [self _appendNamespaces: folders];
{
[folders removeObjectsInArray: additionalFolders];
[folders addObjectsFromArray: additionalFolders];
}
return [folders stringsWithFormat: @"folder%@"]; return [folders stringsWithFormat: @"folder%@"];
} }
@ -420,6 +454,8 @@ static NSString *sieveScriptName = @"sogo";
Class klazz; Class klazz;
id obj; id obj;
[[[self imap4Connection] client] namespace];
if ([_key hasPrefix: @"folder"]) if ([_key hasPrefix: @"folder"])
{ {
folderName = [_key substringFromIndex: 6]; folderName = [_key substringFromIndex: 6];

View file

@ -43,8 +43,11 @@
NSMutableArray *filenames; NSMutableArray *filenames;
NSString *folderType; NSString *folderType;
NSDictionary *mailboxACL; NSDictionary *mailboxACL;
BOOL isNamespace;
} }
- (void) setIsNamespace: (BOOL) newIsNamespace;
- (NSString *) absoluteImap4Name; - (NSString *) absoluteImap4Name;
/* messages */ /* messages */

View file

@ -44,6 +44,7 @@
#import <SOGo/DOMNode+SOGo.h> #import <SOGo/DOMNode+SOGo.h>
#import <SOGo/NSArray+Utilities.h> #import <SOGo/NSArray+Utilities.h>
#import <SOGo/NSString+Utilities.h>
#import <SOGo/NSString+DAV.h> #import <SOGo/NSString+DAV.h>
#import <SOGo/NSArray+DAV.h> #import <SOGo/NSArray+DAV.h>
#import <SOGo/NSObject+DAV.h> #import <SOGo/NSObject+DAV.h>
@ -106,6 +107,7 @@ static NSString *defaultUserID = @"anyone";
{ {
[self _adjustOwner]; [self _adjustOwner];
mailboxACL = nil; mailboxACL = nil;
isNamespace = NO;
} }
return self; return self;
@ -121,9 +123,14 @@ static NSString *defaultUserID = @"anyone";
/* IMAP4 */ /* IMAP4 */
- (void) setIsNamespace: (BOOL) newIsNamespace
{
isNamespace = newIsNamespace;
}
- (NSString *) relativeImap4Name - (NSString *) relativeImap4Name
{ {
return [nameInContainer substringFromIndex: 6]; return [[nameInContainer substringFromIndex: 6] fromCSSIdentifier];
} }
- (NSString *) absoluteImap4Name - (NSString *) absoluteImap4Name

View file

@ -34,17 +34,13 @@
- (id) init - (id) init
{ {
SOGoUserDefaults *ud;
if ((self = [super init])) if ((self = [super init]))
{ {
SOGoUserDefaults *ud;
ud = [[context activeUser] userDefaults]; ud = [[context activeUser] userDefaults];
htmlComposition
// Backward comptability with <= 1.1.0 (ComposeMessagesType) = [[ud mailComposeMessageType] isEqualToString: @"html"];
if ([ud objectForKey: @"ComposeMessagesType"])
htmlComposition = [[ud objectForKey: @"ComposeMessagesType"] isEqualToString: @"html"];
else
htmlComposition = [[ud objectForKey: @"SOGoMailComposeMessageType"] isEqualToString: @"html"];
sourceMail = nil; sourceMail = nil;
currentValue = nil; currentValue = nil;
} }

View file

@ -47,7 +47,7 @@
- (NSString *) jsonRepresentation; - (NSString *) jsonRepresentation;
- (NSString *) asCSSIdentifier; - (NSString *) asCSSIdentifier;
- (NSString *) fromCSSIdentifier;
/* bare email addresses */ /* bare email addresses */
- (NSString *) pureEMailAddress; - (NSString *) pureEMailAddress;

View file

@ -322,6 +322,23 @@ static NSMutableCharacterSet *urlStartChars = nil;
return cssIdentifier; return cssIdentifier;
} }
- (NSString *) fromCSSIdentifier
{
NSMutableString *newString;
newString = [NSMutableString stringWithString: self];
[newString replaceString: @"_U_" withString: @"_"];
[newString replaceString: @"_D_" withString: @"."];
[newString replaceString: @"_H_" withString: @"#"];
[newString replaceString: @"_A_" withString: @"@"];
[newString replaceString: @"_S_" withString: @"*"];
[newString replaceString: @"_C_" withString: @":"];
[newString replaceString: @"_CO_" withString: @","];
[newString replaceString: @"_SP_" withString: @" "];
return newString;
}
- (NSString *) pureEMailAddress - (NSString *) pureEMailAddress
{ {
NSString *pureAddress; NSString *pureAddress;