]> err.no Git - scalable-opengroupware.org/commitdiff
use new API
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 11 Jul 2005 14:10:59 +0000 (14:10 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 11 Jul 2005 14:10:59 +0000 (14:10 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@712 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoMailAccount.m
SOGo/SoObjects/Mailer/SOGoMailBaseObject.h
SOGo/SoObjects/Mailer/SOGoMailBaseObject.m
SOGo/SoObjects/Mailer/SOGoMailBodyPart.m
SOGo/SoObjects/Mailer/SOGoMailFolder.m
SOGo/SoObjects/Mailer/SOGoMailObject.m
SOGo/SoObjects/Mailer/Version
SOGo/SoObjects/Mailer/common.h

index 55ab6f5a745d20c95498d02f73de561de4860a9b..18144025a7ef1abfe56d2f8acde6c3f91627edbb 100644 (file)
@@ -1,5 +1,12 @@
 2005-07-11  Helge Hess  <helge.hess@opengroupware.org>
 
+       * v0.9.98
+       
+       * use new -imap4Connection API everywhere
+       
+       * SOGoMailBaseObject.m: deprecated -mailManager method, added
+         -imap4Connection method
+
        * SOGoMailBaseObject.[hm]: removed unused -imap4Client method (v0.9.97)
        
        * moved SOGoMailManager related API to NGImap4 (NGImap4Connection,
index 05fdcb478e37a9ac9c8ba359cf53bb19a034a0b2..aaf020bf0e55f4d3ae45b39de85b6de6be0698c0 100644 (file)
@@ -59,8 +59,7 @@ static BOOL     useAltNamespace   = NO;
 
   a = rootFolderNames;
   
-  b = [[self mailManager] subfoldersForURL:[self imap4URL] 
-                         password:[self imap4Password]];
+  b = [[self imap4Connection] subfoldersForURL:[self imap4URL]];
   return [b count] > 0 ? [b arrayByAddingObjectsFromArray:a] : a;
 }
 
@@ -73,8 +72,7 @@ static BOOL     useAltNamespace   = NO;
 - (NSArray *)allFolderPathes {
   NSArray *pathes;
   
-  pathes = [[self mailManager] allFoldersForURL:[self imap4URL] 
-                              password:[self imap4Password]];
+  pathes = [[self imap4Connection] allFoldersForURL:[self imap4URL] ];
   pathes = [pathes sortedArrayUsingSelector:@selector(compare:)];
   return pathes;
 }
@@ -309,8 +307,7 @@ static BOOL     useAltNamespace   = NO;
 }
 
 - (NSException *)davCreateCollection:(NSString *)_name inContext:(id)_ctx {
-  return [[self mailManager] createMailbox:_name atURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] createMailbox:_name atURL:[self imap4URL]];
 }
 
 - (NSString *)shortTitle {
index 7003b793ed4cbe70cf1c3005be1dad21e0516f34..924052f031e270826c09c9096eb1db374c9d5be2 100644 (file)
@@ -55,6 +55,7 @@
 
 /* IMAP4 */
 
+- (NGImap4Connection *)imap4Connection;
 - (NGImap4ConnectionManager *)mailManager;
 - (NSURL *)imap4URL;
 - (NSString *)imap4Login;
index 80d85398d52d1f1eaee8e31911f0db2f25546ffe..836f534c04cf83cc904542f02937f26664dc2d36 100644 (file)
@@ -64,6 +64,10 @@ static BOOL debugOn = YES;
 - (NGImap4ConnectionManager *)mailManager {
   return [NGImap4ConnectionManager defaultConnectionManager];
 }
+- (NGImap4Connection *)imap4Connection {
+  return [[self mailManager] connectionForURL:[self imap4URL] 
+                            password:[self imap4Password]];
+}
 
 - (NSString *)relativeImap4Name {
   [self warnWithFormat:@"subclass should override %@", 
index 61873b8c48dfe8a5c27c697a6420f9ebe7607e2f..1a01a70696046476d7cb90db78d5a398364005bd 100644 (file)
@@ -140,9 +140,9 @@ static BOOL debugOn = NO;
   NSString *enc;
   NSData *data;
   
-  data = [[self mailManager] fetchContentOfBodyPart:[self bodyPartIdentifier]
-                            atURL:[self imap4URL]
-                            password:[self imap4Password]];
+  data = [[self imap4Connection] fetchContentOfBodyPart:
+                                  [self bodyPartIdentifier]
+                                atURL:[self imap4URL]];
   if (data == nil) return nil;
 
   /* check for content encodings */
index 38f611944c7f27fda403b669381e2c4c9f46523e..e88885a79f9e2c797339fca387e9d390e4a711ee 100644 (file)
@@ -45,8 +45,7 @@
 /* listing the available folders */
 
 - (NSArray *)toManyRelationshipKeys {
-  return [[self mailManager] subfoldersForURL:[self imap4URL] 
-                            password:[self imap4Password]];
+  return [[self imap4Connection] subfoldersForURL:[self imap4URL]];
 }
 - (NSArray *)toOneRelationshipKeys {
   NSArray  *uids;
@@ -97,8 +96,7 @@
   if (self->selectInfo != nil)
     return nil; /* select info exists, => no error */
   
-  info = [[self mailManager] infoForMailboxAtURL:[self imap4URL]
-                            password:[self imap4Password]];
+  info = [[self imap4Connection] infoForMailboxAtURL:[self imap4URL]];
   if ([info isKindOfClass:[NSException class]])
     return info;
   
   if (self->somfFlags.didCheckMyRights)
     return;
 
-  rights = [[self mailManager] myRightsForMailboxAtURL:[self imap4URL] 
-                              password:[self imap4Password]];
+  rights = [[self imap4Connection] myRightsForMailboxAtURL:[self imap4URL]];
   if ([rights isKindOfClass:[NSException class]]) {
     [self logWithFormat:@"ERROR: could not retrieve ACL: %@", rights];
     return;
 
 - (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so {
   /* seems to return an NSArray of NSNumber's */
-  return [[self mailManager] fetchUIDsInURL:[self imap4URL]
-                            qualifier:_q sortOrdering:_so
-                            password:[self imap4Password]];
+  return [[self imap4Connection] fetchUIDsInURL:[self imap4URL]
+                                qualifier:_q sortOrdering:_so];
 }
 
 - (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts {
-  return [[self mailManager] fetchUIDs:_uids inURL:[self imap4URL]
-                            parts:_parts
-                            password:[self imap4Password]];
+  return [[self imap4Connection] fetchUIDs:_uids inURL:[self imap4URL]
+                                parts:_parts];
 }
 
 - (NSException *)postData:(NSData *)_data flags:(id)_flags {
-  return [[self mailManager] postData:_data flags:_flags
-                            toFolderURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] postData:_data flags:_flags
+                                toFolderURL:[self imap4URL]];
 }
 
 - (NSException *)expunge {
-  return [[self mailManager] expungeAtURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] expungeAtURL:[self imap4URL]];
 }
 
 /* flags */
 
 - (NSException *)addFlagsToAllMessages:(id)_f {
-  return [[self mailManager] addFlags:_f toAllMessagesInURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] addFlags:_f 
+                                toAllMessagesInURL:[self imap4URL]];
 }
 
 /* name lookup */
   sf = [NSURL URLWithString:[[sf path] stringByAppendingPathComponent:_key]
              relativeToURL:sf];
   
-  if (![[self mailManager] doesMailboxExistAtURL:sf
-                          password:[self imap4Password]]) {
+  if (![[self imap4Connection] doesMailboxExistAtURL:sf]) {
     /* 
        We may not return 404, confuses path traversal - but we still do in the
        calling method. Probably the traversal process should be fixed to
 }
 
 - (NSException *)davCreateCollection:(NSString *)_name inContext:(id)_ctx {
-  return [[self mailManager] createMailbox:_name atURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] createMailbox:_name atURL:[self imap4URL]];
 }
 
 - (NSException *)delete {
   /* Note: overrides SOGoObject -delete */
-  return [[self mailManager] deleteMailboxAtURL:[self imap4URL]
-                            password:[self imap4Password]];
+  return [[self imap4Connection] deleteMailboxAtURL:[self imap4URL]];
 }
 
 - (NSException *)davMoveToTargetObject:(id)_target newName:(NSString *)_name
        [[self imap4URL] absoluteString], 
        [destImapURL absoluteString]];
   
-  return [[self mailManager] moveMailboxAtURL:[self imap4URL] toURL:destImapURL
-                            password:[self imap4Password]];
+  return [[self imap4Connection] moveMailboxAtURL:[self imap4URL] 
+                                toURL:destImapURL];
 }
 - (NSException *)davCopyToTargetObject:(id)_target newName:(NSString *)_name
   inContext:(id)_ctx
index 93e0aa680eecb4ff3b8373249257be770a42f3b1..ec9d5c589cebbe84e475cca39c87a67f446ed1de 100644 (file)
@@ -133,8 +133,7 @@ static BOOL debugBodyStructure = NO;
 /* message */
 
 - (id)fetchParts:(NSArray *)_parts {
-  return [[self mailManager] fetchURL:[self imap4URL] parts:_parts
-                            password:[self imap4Password]];
+  return [[self imap4Connection] fetchURL:[self imap4URL] parts:_parts];
 }
 
 /* core infos */
@@ -508,12 +507,10 @@ static BOOL debugBodyStructure = NO;
 /* flags */
 
 - (NSException *)addFlags:(id)_flags {
-  return [[self mailManager] addFlags:_flags toURL:[self imap4URL] 
-                            password:[self imap4Password]];
+  return [[self imap4Connection] addFlags:_flags toURL:[self imap4URL]];
 }
 - (NSException *)removeFlags:(id)_flags {
-  return [[self mailManager] removeFlags:_flags toURL:[self imap4URL] 
-                            password:[self imap4Password]];
+  return [[self imap4Connection] removeFlags:_flags toURL:[self imap4URL]];
 }
 
 /* permissions */
@@ -656,14 +653,12 @@ static BOOL debugBodyStructure = NO;
   
   /* b) mark deleted */
   
-  error = [[self mailManager] markURLDeleted:[self imap4URL] 
-                             password:[self imap4Password]];
+  error = [[self imap4Connection] markURLDeleted:[self imap4URL]];
   if (error != nil) return error;
   
   /* c) expunge */
 
-  error = [[self mailManager] expungeAtURL:[[self container] imap4URL]
-                             password:[self imap4Password]];
+  error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]];
   if (error != nil) return error; // TODO: unflag as deleted?
   [self flushMailCaches];
   
@@ -682,8 +677,7 @@ static BOOL debugBodyStructure = NO;
 
   // TODO: check for safe HTTP method
   
-  error = [[self mailManager] markURLDeleted:[self imap4URL] 
-                             password:[self imap4Password]];
+  error = [[self imap4Connection] markURLDeleted:[self imap4URL]];
   return error;
 }
 - (id)DELETEAction:(id)_ctx {
@@ -691,12 +685,10 @@ static BOOL debugBodyStructure = NO;
   
   // TODO: ensure safe HTTP method
   
-  error = [[self mailManager] markURLDeleted:[self imap4URL] 
-                             password:[self imap4Password]];
+  error = [[self imap4Connection] markURLDeleted:[self imap4URL]];
   if (error != nil) return error;
   
-  error = [[self mailManager] expungeAtURL:[[self container] imap4URL]
-                             password:[self imap4Password]];
+  error = [[self imap4Connection] expungeAtURL:[[self container] imap4URL]];
   if (error != nil) return error; // TODO: unflag as deleted?
   
   return [NSNumber numberWithBool:YES]; /* delete was successful */
index 1dc8c92c8deebc2d4207dba27245d7366b01315d..ccbc76c2b22fedd116c0d4d5867b3c1a8fe1484f 100644 (file)
@@ -1,6 +1,6 @@
 # Version file
 
-SUBMINOR_VERSION:=97
+SUBMINOR_VERSION:=98
 
 # v0.9.96 requires libNGMime       v4.5.223
 # v0.9.91 requires libNGMime       v4.5.222
index c05b976289d29aeeae9396cc83208ba1d0d5e1a3..a11785e5914ee024b25f1bf78a15f432735a03ac 100644 (file)
@@ -33,4 +33,4 @@
 
 #include <NGObjWeb/SoObject+SoDAV.h>
 
-#include <NGImap4/NGImap4Client.h>
+#include <NGImap4/NGImap4Connection.h>