From: helge Date: Wed, 6 Jul 2005 20:27:40 +0000 (+0000) Subject: some work on trash action X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=241bd8e5ddba0db5388dd539430b29430d33cf3e;p=scalable-opengroupware.org some work on trash action git-svn-id: http://svn.opengroupware.org/SOGo/trunk@673 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SoObjects/Mailer/ChangeLog b/SOGo/SoObjects/Mailer/ChangeLog index b4eb1c3d..1acf7ad9 100644 --- a/SOGo/SoObjects/Mailer/ChangeLog +++ b/SOGo/SoObjects/Mailer/ChangeLog @@ -1,5 +1,7 @@ 2005-07-06 Helge Hess + * SOGoMailObject.m: started -trash action (v0.9.86) + * v0.9.85 * SOGoMailFolder.m: added ability to check certain ACL permissions (and diff --git a/SOGo/SoObjects/Mailer/SOGoMailObject.m b/SOGo/SoObjects/Mailer/SOGoMailObject.m index ba300565..455eaba8 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailObject.m +++ b/SOGo/SoObjects/Mailer/SOGoMailObject.m @@ -21,6 +21,7 @@ #include "SOGoMailObject.h" #include "SOGoMailFolder.h" +#include "SOGoMailAccount.h" #include "SOGoMailManager.h" #include "SOGoMailBodyPart.h" #include @@ -609,6 +610,26 @@ static BOOL debugBodyStructure = NO; /* operations */ +- (NSException *)trashAction:(id)_ctx { + SOGoMailFolder *trashFolder; + NSException *error; + + // TODO: check for safe HTTP method + + trashFolder = [[self mailAccountFolder] trashFolderInContext:_ctx]; + if ([trashFolder isKindOfClass:[NSException class]]) + return (NSException *)trashFolder; + if (![trashFolder isNotNull]) { + return [NSException exceptionWithHTTPStatus:500 /* Server Error */ + reason:@"Did not find Trash folder!"]; + } + + error = [self davCopyToTargetObject:trashFolder newName:nil inContext:_ctx]; + if (error != nil) return error; + + return nil; +} + - (NSException *)delete { /* Note: delete is different to DELETEAction: for mails! The 'delete' runs @@ -618,6 +639,8 @@ static BOOL debugBodyStructure = NO; */ // TODO: copy to Trash folder NSException *error; + + // TODO: check for safe HTTP method error = [[self mailManager] markURLDeleted:[self imap4URL] password:[self imap4Password]]; @@ -626,6 +649,8 @@ static BOOL debugBodyStructure = NO; - (id)DELETEAction:(id)_ctx { NSException *error; + // TODO: ensure safe HTTP method + error = [[self mailManager] markURLDeleted:[self imap4URL] password:[self imap4Password]]; if (error != nil) return error; diff --git a/SOGo/SoObjects/Mailer/Version b/SOGo/SoObjects/Mailer/Version index eca7fb4e..668f465c 100644 --- a/SOGo/SoObjects/Mailer/Version +++ b/SOGo/SoObjects/Mailer/Version @@ -1,6 +1,6 @@ # Version file -SUBMINOR_VERSION:=85 +SUBMINOR_VERSION:=86 # v0.9.69 requires libNGMime v4.5.210 # v0.9.55 requires libNGExtensions v4.5.136 diff --git a/SOGo/SoObjects/common.make b/SOGo/SoObjects/common.make index 6cbb8c3e..9b75d5ff 100644 --- a/SOGo/SoObjects/common.make +++ b/SOGo/SoObjects/common.make @@ -14,7 +14,7 @@ ADDITIONAL_INCLUDE_DIRS += \ ADDITIONAL_LIB_DIRS += \ -L../SOGo/$(GNUSTEP_OBJ_DIR)/ \ - -L../../../OGoContentStore/$(GNUSTEP_OBJ_DIR)/ \ + -L../../OGoContentStore/$(GNUSTEP_OBJ_DIR)/ \ -L/usr/local/lib -L/usr/lib BUNDLE_LIBS += \