Monotone-Parent: 351c343491eb5005eeec456fd7caf97dd6c27489

Monotone-Revision: f445ddae9e72252fda8d9a7adee3c89ef2f81c87

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-05-28T19:05:00
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-05-28 19:05:00 +00:00
parent 85d84068ac
commit 52c2283eba
7 changed files with 100 additions and 77 deletions
-40
View File
@@ -539,46 +539,6 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:@"view"];
}
- (id) emptyTrashAction
{
// TODO: we might want to flush the caches?
NSException *error;
id client;
if ((client = [self clientObject]) == nil) {
error = [NSException exceptionWithHTTPStatus:404 /* Not Found */
reason:@"did not find mail folder"];
return [self redirectToViewWithError:error];
}
if (![client isKindOfClass:NSClassFromString(@"SOGoTrashFolder")]) {
/* would be better to move the method to an own class, but well .. */
error = [NSException exceptionWithHTTPStatus:400 /* Bad Request */
reason:@"method cannot be invoked on "
@"the specified object"];
return [self redirectToViewWithError:error];
}
/* mark all as deleted */
[self logWithFormat:@"TODO: must mark all as deleted for empty-trash"];
error = [[self clientObject] addFlagsToAllMessages:@"deleted"];
if (error != nil)
// TODO: improve error
return [self redirectToViewWithError:error];
/* expunge */
if ((error = [[self clientObject] expunge]) != nil)
// TODO: improve error
return [self redirectToViewWithError:error];
if ([client respondsToSelector:@selector(flushMailCaches)])
[client flushMailCaches];
return [self redirectToLocation:@"view"];
}
@end
/* UIxMailListView */