Monotone-Parent: 48ab3ba04ae37aa55ddec9a67b39c8be57786c6d

Monotone-Revision: 66fc4d9ee925358de80c05092a80e0b39ae6c95d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-09-11T19:41:40
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-09-11 19:41:40 +00:00
parent 956f628360
commit f2e7a70a2c
5 changed files with 54 additions and 88 deletions
-61
View File
@@ -421,36 +421,8 @@ static int attachmentFlagSize = 8096;
return [self redirectToLocation:url];
}
/* active message */
- (SOGoMailObject *) lookupActiveMessage
{
NSString *uid;
if ((uid = [[context request] formValueForKey: @"uid"]) == nil)
return nil;
return [[self clientObject] lookupName: uid
inContext: context
acquire: NO];
}
/* actions */
- (BOOL) isJavaScriptRequest
{
return [[[context request] formValueForKey:@"jsonly"] boolValue];
}
- (id) javaScriptOK
{
WOResponse *r;
r = [context response];
[r setStatus:200 /* OK */];
return r;
}
- (int) firstMessageOfPageFor: (int) messageNbr
{
NSArray *messageNbrs;
@@ -523,39 +495,6 @@ static int attachmentFlagSize = 8096;
return self;
}
- (id) viewAction
{
return [self defaultAction];
}
- (id) markMessageUnreadAction
{
NSException *error;
if ((error = [[self lookupActiveMessage] removeFlags:@"seen"]) != nil)
// TODO: improve error handling
return error;
if ([self isJavaScriptRequest])
return [self javaScriptOK];
return [self redirectToLocation:@"view"];
}
- (id) markMessageReadAction
{
NSException *error;
if ((error = [[self lookupActiveMessage] addFlags:@"seen"]) != nil)
// TODO: improve error handling
return error;
if ([self isJavaScriptRequest])
return [self javaScriptOK];
return [self redirectToLocation:@"view"];
}
- (id) getMailAction
{
// TODO: we might want to flush the caches?