Added support for MailDAV PUT

Monotone-Parent: 90509c89f14ff1a8b0d7884244366bd33783ccc1
Monotone-Revision: 8515028ade639f5e3e38f20b4eba28b16a1250b1

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-09-29T20:13:36
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert committed 2009-09-29 20:13:36 +00:00
1 parent 0aaaf59814
commit 9493a33729
17 files changed
+344 -52

No files matched your search

+30
View File
@@ -1239,4 +1239,34 @@ static BOOL debugSoParts = NO;
return debugOn;
}
// For DAV PUT
- (id) PUTAction: (WOContext *) _ctx
{
WORequest *rq;
NSException *error;
WOResponse *response;
SOGoMailFolder *folder;
int imap4id;
error = [self matchesRequestConditionInContext: _ctx];
if (error)
response = (WOResponse *) error;
else
{
rq = [_ctx request];
folder = [self container];
if ([self doesMailExist])
response = [NSException exceptionWithHTTPStatus: 403
reason: @"Can't overwrite messages"];
else
response = [folder appendMessage: [rq content]
inContext: _ctx
usingId: &imap4id];
}
return response;
}
@end /* SOGoMailObject */