mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 19:35:38 +00:00
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:
+23
-18
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user