+2005-02-14 Helge Hess <helge.hess@opengroupware.org>
+
+ * v0.9.74
+
+ * SOGoMailAccount.m: fetch all root folders from IMAP4, do not assume
+ "INBOX"
+
+ * SOGoMailManager.m: properly support rootfolders in IMAP4
+
2005-02-13 Helge Hess <helge.hess@opengroupware.org>
* SOGoMailAccount.m: changed short title creation to use login@host
if ([ud boolForKey:@"SOGoEnableSieveFolder"]) {
rootFolderNames = [[NSArray alloc] initWithObjects:
- inboxFolderName,
draftsFolderName,
sieveFolderName,
nil];
}
else {
rootFolderNames = [[NSArray alloc] initWithObjects:
- inboxFolderName,
draftsFolderName,
nil];
}
/* listing the available folders */
- (NSArray *)toManyRelationshipKeys {
- // TODO: hardcoded, if we want to support shared fldrs, this needs to change
- return rootFolderNames;
+ NSArray *a, *b;
+
+ a = rootFolderNames;
+
+ b = [[self mailManager] subfoldersForURL:[self imap4URL]
+ password:[self imap4Password]];
+ return [b count] > 0 ? [b arrayByAddingObjectsFromArray:a] : a;
}
/* hierarchy */
static BOOL debugCache = NO;
static BOOL debugKeys = NO;
static BOOL poolingOff = NO;
-static BOOL alwaysSelect = NO;
+static BOOL alwaysSelect = NO;
+static BOOL onlyFetchInbox = NO;
static NSTimeInterval PoolScanInterval = 5 * 60;
static NSString *imap4Separator = nil;
/* one entry is the folder itself, so we need at least two */
return [NSArray array];
- prefixlen = [_fn length] + 1;
+ prefixlen = [_fn isEqualToString:@"/"] ? 1 : [_fn length] + 1;
ma = [NSMutableArray arrayWithCapacity:count];
for (i = 0; i < count; i++) {
NSString *p;
return nil;
}
- if (debugKeys)
- [self logWithFormat:@"all keys %@: %@", folderName, [result allKeys]];
+ if (debugKeys) {
+ [self logWithFormat:@"all keys %@: %@", folderName,
+ [[result allKeys] componentsJoinedByString:@", "]];
+ }
names = [self _getDirectChildren:[result allKeys] folderName:folderName];
if (debugKeys) {
- [self debugWithFormat:@"subfolders of %@: %@", folderName,
+ [self logWithFormat:@"subfolders of '%@': %@", folderName,
[names componentsJoinedByString:@","]];
}
return names;
/* fetch _all_ folders */
- result = [[entry client] list:@"INBOX" pattern:@"*"];
+ result = [[entry client] list:(onlyFetchInbox ? @"INBOX" : @"*")
+ pattern:@"*"];
if (![[result valueForKey:@"result"] boolValue]) {
[self errorWithFormat:@"listing of folder failed!"];
return nil;