Minor fixes

Monotone-Parent: 8515028ade639f5e3e38f20b4eba28b16a1250b1
Monotone-Revision: b092fe6aebfa4e00c827df976eaa7e49cb1c6539

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-29T20:39:23
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-09-29 20:39:23 +00:00
parent 9493a33729
commit d871fe0bd8
2 changed files with 15 additions and 12 deletions
+8 -2
View File
@@ -1145,14 +1145,20 @@ static NSString *spoolFolder = nil;
response = [_ctx response];
[response setStatus: 201];
msg = [SOGoMailObject objectWithName:
[NSString stringWithFormat: @"%d", imap4id]
[NSString stringWithFormat: @"%d", *imap4id]
inContainer: self];
if (msg)
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"];
}
}
return response;