]> err.no Git - scalable-opengroupware.org/commitdiff
fixed problem with Cyrus altnamespace
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Feb 2005 16:51:09 +0000 (16:51 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Feb 2005 16:51:09 +0000 (16:51 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@560 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoMailAccount.m
SOGo/SoObjects/Mailer/SOGoMailManager.m
SOGo/SoObjects/Mailer/Version

index 4565a458886d2a6b2c94063dd043b5ccd5c8491e..1e74cf3b7fd2b0bba96597c35578b919f043e35f 100644 (file)
@@ -1,3 +1,12 @@
+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
index 1d429846aee7224abf6ee7b42084396f94043877..a1eb1083371925df97a53ca1ba4be51c8b1368ad 100644 (file)
@@ -38,14 +38,12 @@ static NSString *sieveFolderName  = @"Filters";
 
   if ([ud boolForKey:@"SOGoEnableSieveFolder"]) {
     rootFolderNames = [[NSArray alloc] initWithObjects:
-                                       inboxFolderName, 
                                        draftsFolderName, 
                                        sieveFolderName, 
                                      nil];
   }
   else {
     rootFolderNames = [[NSArray alloc] initWithObjects:
-                                       inboxFolderName, 
                                        draftsFolderName, 
                                      nil];
   }
@@ -54,8 +52,13 @@ static NSString *sieveFolderName  = @"Filters";
 /* 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 */
index fd6ba0624a9b185f0d0a6ae903fb2fd1d1ddd345..cf7ddb58d16f988e906cb03dc43c305e2281b204 100644 (file)
@@ -40,7 +40,8 @@ static BOOL           debugOn    = NO;
 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;
 
@@ -256,7 +257,7 @@ 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;
@@ -337,12 +338,14 @@ static NSString       *imap4Separator  = nil;
     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;
@@ -374,7 +377,8 @@ static NSString       *imap4Separator  = nil;
   
   /* 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;
index 77d2e6e0371d1304768e9d0fdc4c2cfec8f9f2d6..b127af6bb8ab1b62fefa33ca12de240387dec592 100644 (file)
@@ -1,6 +1,6 @@
 # Version file
 
-SUBMINOR_VERSION:=73
+SUBMINOR_VERSION:=74
 
 # v0.9.69 requires libNGMime       v4.5.210
 # v0.9.55 requires libNGExtensions v4.5.136