]> err.no Git - scalable-opengroupware.org/commitdiff
fixed SOGo bug #1054, deactivated some unused toolbar buttons
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 26 Jan 2005 22:42:29 +0000 (22:42 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 26 Jan 2005 22:42:29 +0000 (22:42 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@501 d1b88da0-ebda-0310-925b-ed51d893ca5b

18 files changed:
SOGo/SoObjects/Mailer/ChangeLog
SOGo/SoObjects/Mailer/SOGoDraftObject.h
SOGo/SoObjects/Mailer/SOGoDraftObject.m
SOGo/SoObjects/Mailer/SOGoDraftsFolder.h
SOGo/SoObjects/Mailer/SOGoMailAccount.h
SOGo/SoObjects/Mailer/SOGoMailAccount.m
SOGo/SoObjects/Mailer/SOGoMailBaseObject.h
SOGo/SoObjects/Mailer/SOGoMailBaseObject.m
SOGo/SoObjects/Mailer/SOGoMailFolder.h
SOGo/SoObjects/Mailer/SOGoMailFolder.m
SOGo/SoObjects/Mailer/SOGoMailManager.h
SOGo/SoObjects/Mailer/SOGoMailManager.m
SOGo/SoObjects/Mailer/Version
SOGo/UI/Mailer/ChangeLog
SOGo/UI/Mailer/UIxMailEditor.m
SOGo/UI/Mailer/UIxMailListView.m
SOGo/UI/Mailer/Version
SOGo/UI/Mailer/product.plist

index a8b3bf59e98ea306b37bd27023c44440efd59a2c..fed1b2afca6d97d30b6b7aff2da634bd53d8b1fe 100644 (file)
@@ -1,3 +1,12 @@
+2005-01-26  Helge Hess  <helge.hess@skyrix.com>
+       
+       * v0.9.56
+       
+       * SOGoMailManager.m, SOGoMailFolder.m: added method to save new
+         content in an SOGoMailFolder (to support #1054)
+       
+       * SOGoMailAccount.m: minor code cleanup
+
 2004-12-08  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * SOGoMailAccount.m, SOGoMailBaseObject.m, SOGoMailObject.m,
index 7f0393edf937e163ec462a9b9b1f90172d9e6bd7..0043021c03564ae7b2b7047a330daf11602c0d0f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
index 14a92522cc154fe723f65ef46f0a297114f4e3d3..be9909bd413909ce03a76a5b71ddd9216e76c92f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
index b938b1ddf19ee852c8e8615bc208fd987921591d..45f7f7e04146e02b9363f31885d2b238ed260813 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #ifndef __Mailer_SOGoDraftsFolder_H__
 #define __Mailer_SOGoDraftsFolder_H__
index 809e20a5349b39492d873ae96cf4eb168543c665..2a19c958e0153b4393d73bef39ed1fc2c0b4b086 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: SOGoMailAccount.h 274 2004-08-26 13:10:49Z znek $
 
 #ifndef __Mailer_SOGoMailAccount_H__
 #define __Mailer_SOGoMailAccount_H__
index ed47e5220b315fb4f5410a88f859f72da26acc56..ae5e3353c2a1e2ab07c70694721d6ed30dbaceb5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id: SOGoMailAccount.m 274 2004-08-26 13:10:49Z znek $
 
 #include "SOGoMailAccount.h"
 #include "SOGoMailFolder.h"
@@ -28,6 +27,9 @@
 
 @implementation SOGoMailAccount
 
+static NSString *draftsFolderName = @"Drafts";
+static NSString *sieveFolderName  = @"Filters";
+
 /* listing the available folders */
 
 - (NSArray *)toManyRelationshipKeys {
@@ -48,7 +50,7 @@
 
 - (NSArray *)allFolderPathes {
   NSArray *pathes;
-
+  
   pathes = [[self mailManager] allFoldersForURL:[self imap4URL] 
                               password:[self imap4Password]];
   pathes = [pathes sortedArrayUsingSelector:@selector(compare:)];
   
   // TODO: those should be product.plist bindings? (can't be class bindings
   //       though because they are 'per-account')
-  if ([_key isEqualToString:@"Drafts"]) {
+  if ([_key isEqualToString:draftsFolderName]) {
     if ((obj = [self lookupDraftsFolder:_key inContext:_ctx]) != nil)
       return obj;
   }
-  if ([_key isEqualToString:@"Filters"]) {
+  if ([_key isEqualToString:sieveFolderName]) {
     if ((obj = [self lookupFiltersFolder:_key inContext:_ctx]) != nil)
       return obj;
   }
index b98e4445d4ce1d904767ed65aec95a7892d8c959..8aca72f6affaf5d47e25eac9a09824cd5a3bf26e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
index e264229124675adbe0333f8dcced33dbabf124ab..1e72e8343355aacb25e4c6003f2ec786b63090ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #include "SOGoMailBaseObject.h"
 #include "SOGoMailManager.h"
index 321dbf9e41801682be282f1f5551dc7ef5631b71..ad9d6acbe656fbe60f1b1e2bed68499ae5f43b7c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -33,7 +33,7 @@
   The SOGoMailFolder maps to an IMAP4 folder from NGImap4.
 */
 
-@class NSArray;
+@class NSData, NSArray, NSException;
 
 @interface SOGoMailFolder : SOGoMailBaseObject
 {
@@ -45,6 +45,8 @@
 - (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so;
 - (NSArray *)fetchUIDs:(NSArray *)_uids parts:(NSArray *)_parts;
 
+- (NSException *)postData:(NSData *)_data flags:(id)_flags;
+
 @end
 
 #endif /* __Mailer_SOGoMailFolder_H__ */
index 6aa2b5646c5dcf2fe439c186f0d81c21fba14c8d..5b5d87c38a26738216a7c498954808d2de48b412 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -18,7 +18,6 @@
   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
   02111-1307, USA.
 */
-// $Id$
 
 #include "SOGoMailFolder.h"
 #include "SOGoMailObject.h"
                             password:[self imap4Password]];
 }
 
+- (NSException *)postData:(NSData *)_data flags:(id)_flags {
+  return [[self mailManager] postData:_data flags:_flags
+                            toFolderURL:[self imap4URL]
+                            password:[self imap4Password]];
+}
+
 /* name lookup */
 
 - (BOOL)isMessageKey:(NSString *)_key inContext:(id)_ctx {
index 0c7d0a95a0c825ecd802645ec145a227decadcf1..baa3bcbc2d6e830f59a82f83062ad5b543c4cca3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -72,6 +72,9 @@
 - (NSException *)addFlags:(id)_f    toURL:(NSURL *)_u password:(NSString *)_p;
 - (NSException *)removeFlags:(id)_f toURL:(NSURL *)_u password:(NSString *)_p;
 
+- (NSException *)postData:(NSData *)_data flags:(id)_flags
+  toFolderURL:(NSURL *)_url password:(NSString *)_p;
+
 /* managing folders */
 
 - (NSException *)createMailbox:(NSString *)_mailbox atURL:(NSURL *)_url
index a785744723b01a524098a40350e448d17f9619b9..633504b85f92afac462bf66c0054d479ad927c57 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
@@ -616,6 +616,33 @@ static NSString       *imap4Separator  = nil;
   return [self addOrRemove:NO flags:_f toURL:_u password:_p];
 }
 
+- (NSException *)postData:(NSData *)_data flags:(id)_f
+  toFolderURL:(NSURL *)_url password:(NSString *)_p
+{
+  NGImap4Client *client;
+  id result;
+  
+  if (![_url isNotNull]) return nil;
+  if (![_f   isNotNull]) _f = [NSArray array];
+  
+  if ((client = [self imap4ClientForURL:_url password:_p]) == nil)
+    return nil;
+  
+  if (![_f isKindOfClass:[NSArray class]])
+    _f = [NSArray arrayWithObjects:&_f count:1];
+  
+  result = [client append:_data 
+                  toFolder:[self imap4FolderNameForURL:_url]
+                  withFlags:_f];
+  if (![[result valueForKey:@"result"] boolValue]) {
+    [self logWithFormat:@"DEBUG: fail result %@", result];
+    return [NSException exceptionWithHTTPStatus:500 /* server error */
+                       reason:@"failed to store message to IMAP4 message"];
+  }
+  /* result contains 'fetch' key with the current flags */
+  return nil;
+}
+
 /* managing folders */
 
 - (BOOL)isPermissionDeniedResult:(id)_result {
index 0c6616149ffa25559b26c6a322bc8987288c4dc2..73743e4374acb02acf349d1c792db1d6f4cecc84 100644 (file)
@@ -1,6 +1,6 @@
 # Version file
 
-SUBMINOR_VERSION:=55
+SUBMINOR_VERSION:=56
 
 # v0.9.55 requires NGExtensions v4.5.136
 # v0.9.44 requires libNGMime    v4.3.194
index 7f8b7da46f9228d7202495e731b0f3f8e30baad4..e06572d119bb0bddda01893e6daa049e5190454a 100644 (file)
@@ -1,5 +1,12 @@
 2005-01-26  Helge Hess  <helge.hess@skyrix.com>
 
+       * v0.9.75
+
+       * UIxMailEditor.m: copy sent mails to INBOX/Sent folder, fixes issue
+         #1054
+
+       * product.plist: disabled unsupported delete button in mailviewer
+
        * UIxMailListView.wox: removed unused mail checkboxes and folder-tree
          popup (#1211) (v0.9.74)
 
index 0343236a57dc8d091b3ca740507952b19befa824..449d0aaa753cc05b373e3f159ad2db2372624c66 100644 (file)
@@ -28,6 +28,7 @@
 */
 
 @class NSArray, NSString;
+@class SOGoMailFolder;
 
 @interface UIxMailEditor : UIxComponent
 {
   NSArray  *bcc;
   NSString *subject;
   NSString *text;
+  SOGoMailFolder *sentFolder;
 }
 
 @end
 
 #include <SOGo/SoObjects/Mailer/SOGoDraftObject.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailFolder.h>
+#include <SOGo/SoObjects/Mailer/SOGoMailAccount.h>
 #include <NGMail/NGMimeMessage.h>
 #include <NGMail/NGMimeMessageGenerator.h>
 #include "common.h"
@@ -52,7 +56,6 @@
 @implementation UIxMailEditor
 
 static BOOL keepMailTmpFile    = NO;
-static BOOL keepDraftAfterSend = NO;
 static NSArray *infoKeys = nil;
 
 + (void)initialize {
@@ -60,12 +63,13 @@ static NSArray *infoKeys = nil;
                                @"subject", @"text", @"to", @"cc", @"bcc", 
                                @"from", @"replyTo",
                              nil];
-
+  
   if (keepMailTmpFile)
     NSLog(@"WARNING: keeping mail files.");
 }
 
 - (void)dealloc {
+  [self->sentFolder release];
   [self->text    release];
   [self->subject release];
   [self->to      release];
@@ -154,9 +158,48 @@ static NSArray *infoKeys = nil;
   return nil;
 }
 
+- (id)lookupSentFolder {
+  /* lookup INBOX/Sent folder */
+  SOGoMailAccount *account;
+  SOGoMailFolder  *folder;
+
+  if (self->sentFolder != nil)
+    return self;
+
+  account = [[self clientObject] mailAccountFolder];
+  if ([account isKindOfClass:[NSException class]]) return account;
+  
+  folder = [account lookupName:@"INBOX" inContext:[self context] acquire:NO];
+  if ([folder isKindOfClass:[NSException class]]) return folder;
+  
+  folder = [folder lookupName:@"Sent" inContext:[self context] acquire:NO];
+  if ([folder isKindOfClass:[NSException class]]) return folder;
+
+  if (![folder isNotNull]) {
+    return [NSException exceptionWithHTTPStatus:500 /* server error */
+                       reason:@"did not find Sent folder!"];
+  }
+  
+  self->sentFolder = [folder retain];
+  return self->sentFolder;
+}
+
 - (NSException *)storeMailInSentFolder:(NSString *)_path {
-  [self logWithFormat:@"TODO: store mail in Sent folder: %@", _path];
-  return nil;
+  SOGoMailFolder *folder;
+  NSData *data;
+  id result;
+  
+  folder = [self lookupSentFolder];
+  if ([folder isKindOfClass:[NSException class]]) return (id)folder;
+  
+  if ((data = [[NSData alloc] initWithContentsOfMappedFile:_path]) == nil) {
+    return [NSException exceptionWithHTTPStatus:500 /* server error */
+                       reason:@"could not temporary draft file!"];
+  }
+  
+  result = [folder postData:data flags:@"seen"];
+  [data release]; data = nil;
+  return result;
 }
 
 /* actions */
@@ -239,13 +282,9 @@ static NSArray *infoKeys = nil;
   
   /* delete draft */
   
-  if (keepDraftAfterSend) {
-    [self warnWithFormat:@"keeping draft object: '%@'", 
-            [self clientObject]];
-  }
-  else if ((error = [[self clientObject] delete]) != nil)
+  if ((error = [[self clientObject] delete]) != nil)
     return error;
-  
+
   // if everything is ok, close the window (send a JS closing the Window)
   return [self pageWithName:@"UIxMailWindowCloser"];
 }
index 4b58be58c1f8678686cdd22980d98853a643ec35..ca08bb2c66c3414be7df4d190cd1b3485286dd95 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2004 SKYRIX Software AG
+  Copyright (C) 2004-2005 SKYRIX Software AG
 
   This file is part of OpenGroupware.org.
 
index e1738a6e493abe887f7c36b71b8cc98642b6b4bc..fa87263e21e70f049b9e1fcaf4e53e6701509007 100644 (file)
@@ -1,9 +1,10 @@
 # version file
 
-SUBMINOR_VERSION:=74
+SUBMINOR_VERSION:=75
 
-# v0.9.70 requires NGExtensions v4.5.136
-# v0.9.69 requires libNGMime    v4.5.203
-# v0.9.50 requires libNGMime    v4.3.190
-# v0.9.43 requires libNGObjWeb  v4.3.73
-# v0.9.42 requires libNGObjWeb  v4.3.72
+# v0.9.74 requires SoObjects/Mailer v0.9.56
+# v0.9.70 requires NGExtensions     v4.5.136
+# v0.9.69 requires libNGMime        v4.5.203
+# v0.9.50 requires libNGMime        v4.3.190
+# v0.9.43 requires libNGObjWeb      v4.3.73
+# v0.9.42 requires libNGObjWeb      v4.3.72
index 75492f061fb63e0fa529be888aa3030a491b0c68..78084786a49c810f2af9b7635b2b97d73de401fa 100644 (file)
               { link = "#"; cssClass = "tbicon_forward";  label = "Forward";   },
             ),
 */
-            ( /* third group */
+/* TODO: enable when implemented
+            ( // third group
+// TODO: enable when delete works (#1212)
               { link = "#"; 
                 cssClass = "tbicon_delete"; label = "Delete"; },
-/* TODO: enable when we know how to mark junk (#971)
+// TODO: enable when we know how to mark junk (#971)
               { link = "#"; 
                 cssClass = "tbicon_junk";   label = "Junk";   },
-*/
             ),
+*/
             ( /* fourth group */
 /* TODO: enable when we can print (#1207)
               { link = "#"; cssClass = "tbicon_print"; label = "Print"; },
                 cssClass = "tbicon_forward";  label = "Forward";   },
             ),
 */
-            ( /* third group */
+/* TODO: enable when implemented
+            ( // third group
+// TODO: enable when delete works (#1212)
               { link = "#"; 
                 cssClass = "tbicon_delete"; label = "Delete"; },
-/* TODO: enable when we know how to mark junk (#971)
+// TODO: enable when we know how to mark junk (#971)
               { link = "#"; 
                 cssClass = "tbicon_junk";   label = "Junk";   },
-*/
             ),
+*/
             ( /* fourth group */
 /* TODO: enable when we can print (#1207)
               { link = "#"; cssClass = "tbicon_print"; label = "Print"; },