Monotone-Parent: 7da0a932cddc9269a4a07975e812b303fec2fbf4

Monotone-Revision: 70caa6c315c0b61c28f0ef9d832f18f6cd4ba00f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-10-22T16:07:12
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-10-22 16:07:12 +00:00
parent 63f2318095
commit 088482accb
4 changed files with 54 additions and 14 deletions
+6
View File
@@ -1,5 +1,11 @@
2007-10-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder
-allFolderPaths]): new method that returns all the paths of all
the subfolders of the folder object.
([SOGoMailFolder -allFolderURLs]): new method replacing
subfoldersURL.
* SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject
-aclsForUser:uid]): object inherits the 'SOGoRole_ObjectEditor'
role from its parent folder.
+11 -7
View File
@@ -43,25 +43,29 @@
NSDictionary *mailboxACL;
}
- (NSString *) absoluteImap4Name;
/* messages */
- (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so;
- (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts;
- (NSArray *) fetchUIDsMatchingQualifier: (id)_q sortOrdering: (id) _so;
- (NSArray *) fetchUIDs: (NSArray *) _uids parts: (NSArray *) _parts;
- (NSException *)postData:(NSData *)_data flags:(id)_flags;
- (NSException *) postData: (NSData *) _data flags: (id) _flags;
- (NSException *)expunge;
- (NSException *) expunge;
/* flags */
- (NSException *)addFlagsToAllMessages:(id)_f;
- (NSException *) addFlagsToAllMessages: (id) _f;
/* folder type */
- (NSString *)outlookFolderClass;
- (NSString *) outlookFolderClass;
- (NSArray *) subfolders;
- (NSArray *) subfoldersURL;
- (NSArray *) allFolderPaths;
- (NSArray *) allFolderURLs;
@end
+36 -6
View File
@@ -106,6 +106,16 @@ static BOOL useAltNamespace = NO;
return [nameInContainer substringFromIndex: 6];
}
- (NSString *) absoluteImap4Name
{
NSString *name;
name = [[self imap4URL] path];
if (![name hasSuffix: @"/"])
name = [name stringByAppendingString: @"/"];
return name;
}
- (NSMutableString *) imap4URLString
{
@@ -129,25 +139,45 @@ static BOOL useAltNamespace = NO;
return [[self imap4Connection] subfoldersForURL: [self imap4URL]];
}
- (NSArray *) subfoldersURL
- (NSArray *) allFolderPaths
{
NSMutableArray *deepSubfolders;
NSEnumerator *folderNames;
NSArray *result;
NSString *currentFolderName, *prefix;
deepSubfolders = [NSMutableArray new];
[deepSubfolders autorelease];
prefix = [self absoluteImap4Name];
result = [[self mailAccountFolder] allFolderPaths];
folderNames = [result objectEnumerator];
while ((currentFolderName = [folderNames nextObject]))
if ([currentFolderName hasPrefix: prefix])
[deepSubfolders addObject: currentFolderName];
[deepSubfolders sortUsingSelector: @selector (compare:)];
return deepSubfolders;
}
- (NSArray *) allFolderURLs
{
NSURL *selfURL, *currentURL;
NSMutableArray *subfoldersURL;
NSEnumerator *subfolders;
NSString *selfPath, *currentFolder;
NSString *currentFolder;
subfoldersURL = [NSMutableArray array];
selfURL = [self imap4URL];
selfPath = [selfURL path];
subfolders = [[self subfolders] objectEnumerator];
subfolders = [[self allFolderPaths] objectEnumerator];
currentFolder = [subfolders nextObject];
while (currentFolder)
{
currentURL = [[NSURL alloc]
initWithScheme: [selfURL scheme]
host: [selfURL host]
path: [selfPath stringByAppendingPathComponent:
currentFolder]];
path: currentFolder];
[currentURL autorelease];
[subfoldersURL addObject: currentURL];
currentFolder = [subfolders nextObject];
+1 -1
View File
@@ -265,7 +265,7 @@
{
[co flushMailCaches];
connection = [co imap4Connection];
subfolders = [[co subfoldersURL] objectEnumerator];
subfolders = [[co allFolderURLs] objectEnumerator];
currentURL = [subfolders nextObject];
while (currentURL)
{