From 546d683137ebac780e00255f04c0029d90b5b3ac Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 1 Oct 2009 14:47:51 +0000 Subject: [PATCH] Monotone-Parent: 3c4b94054ca0b56c5e59f42bb1293b5f1040611c Monotone-Revision: e2c92d491c4f1a4138cd77034e3c0a712bf09003 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-10-01T14:47:51 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/Mailer/SOGoMailFolder.m | 20 +++----------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0850c935..10c399394 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-01 Cyril Robert + + * SoObjects/Mailer/SOGoMailFolder.m + (-appendMessage:inContext:usingId:): we no longer instantiate the + message to check whether it exists since we trust the fact that we + would receive an error from NGImap if the creation failed. + 2009-10-01 Wolfgang Sourdeau * Tests/test-maildav.py (DAVMailCollectionTest.testPUT): fixed to diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index 107c0e784..8b56fbee7 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -1133,32 +1133,18 @@ static NSString *spoolFolder = nil; NSException *error; WOResponse *response; NSString *location; - id msg; error = [self _appendMessageData: message usingId: imap4id]; - if (error) response = (WOResponse *) error; else { response = [_ctx response]; [response setStatus: 201]; - msg = [SOGoMailObject objectWithName: - [NSString stringWithFormat: @"%d", *imap4id] - inContainer: self]; - if (msg && [msg doesMailExist]) - { - location = [NSString stringWithFormat: @"%@%d.eml", - [self davURL], *imap4id]; - [response setHeader: location forKey: @"location"]; - } - else - { - response = (WOResponse *) - [NSException exceptionWithHTTPStatus: 500 - reason: @"Failed to store message"]; - } + location = [NSString stringWithFormat: @"%@%d.eml", + [self davURL], *imap4id]; + [response setHeader: location forKey: @"location"]; } return response;