Monotone-Parent: 7f76103f70f06e2d9d23dda324c36f84d85eae1c

Monotone-Revision: 2b96d00aec89e2290a01e1ee04bdc8cee5487139

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-08-23T20:58:41
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-08-23 20:58:41 +00:00
parent aa9312f278
commit a2b5a5b4bb
8 changed files with 126 additions and 53 deletions
+23 -18
View File
@@ -587,33 +587,38 @@ static NSArray *infoKeys = nil;
return error;
}
- (id <WOActionResults>) sendAction
- (WOResponse *) sendAction
{
id <WOActionResults> result;
SOGoDraftObject *co;
NSDictionary *jsonResponse;
NSException *error;
co = [self clientObject];
// TODO: need to validate whether we have a To etc
/* first, save form data */
result = (id <WOActionResults>) [self validateForSend];
if (!result)
error = [self validateForSend];
if (!error)
{
if ([self _saveFormInfo])
{
result = (id <WOActionResults>) [[self clientObject] sendMail];
if (!result)
{
co = [self clientObject];
result = [self jsCloseWithRefreshMethod: [NSString stringWithFormat: @"refreshMessage(\"%@\", %i)",
[co sourceFolder],
[co IMAP4ID]]];
}
}
error = [co sendMail];
else
result = [self failedToSaveFormResponse];
error = [self failedToSaveFormResponse];
}
return result;
if (error)
jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys:
@"failure", @"status",
[error reason], @"message",
nil];
else
jsonResponse = [NSDictionary dictionaryWithObjectsAndKeys:
@"success", @"status",
[co sourceFolder], @"sourceFolder",
[co IMAP4ID], @"messageID",
nil];
return [self responseWithStatus: 200
andString: [jsonResponse jsonRepresentation]];
}
@end /* UIxMailEditor */