From 499384c24240b49ba9a0adaa7940b0f1836d9099 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 30 Jul 2007 18:39:55 +0000 Subject: [PATCH] Monotone-Parent: ad2d3271fb0e1e8ef38a2f6ed2d28f749a5f3623 Monotone-Revision: 7d0ca861b776cb009eb7120a75102f92944c061d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-30T18:39:55 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailEditor.m | 41 +++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index ffae1214b..89d8cd2ab 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -269,13 +269,16 @@ static NSArray *infoKeys = nil; /* requests */ -- (BOOL)shouldTakeValuesFromRequest:(WORequest *)_rq inContext:(WOContext*)_c{ +- (BOOL) shouldTakeValuesFromRequest: (WORequest *) _rq + inContext: (WOContext*) _c +{ return YES; } /* IMAP4 store */ -- (NSException *)patchFlagsInStore { +- (NSException *) patchFlagsInStore +{ /* Flags we should set: if the draft is a reply => [message markAnswered] @@ -286,7 +289,8 @@ static NSArray *infoKeys = nil; return nil; } -- (id)lookupSentFolderUsingAccount { +- (id) lookupSentFolderUsingAccount +{ SOGoMailAccount *account; SOGoMailFolder *folder; @@ -301,7 +305,8 @@ static NSArray *infoKeys = nil; return ((sentFolder = [folder retain])); } -- (void)_presetFromBasedOnAccountsQueryParameter { +- (void) _presetFromBasedOnAccountsQueryParameter +{ /* preset the from field to the primary identity of the given account */ /* Note: The compose action sets the 'accounts' query parameter */ NSString *accountID; @@ -337,7 +342,8 @@ static NSArray *infoKeys = nil; [self setFrom: [identity email]]; } -- (SOGoMailIdentity *)selectedMailIdentity { +- (SOGoMailIdentity *) selectedMailIdentity +{ SOGoMailAccounts *accounts; NSEnumerator *e; SOGoMailIdentity *identity; @@ -360,7 +366,8 @@ static NSArray *infoKeys = nil; return nil; } -- (id)lookupSentFolderUsingFrom { +- (id) lookupSentFolderUsingFrom +{ // TODO: if we have the identity we could also support BCC SOGoMailAccounts *accounts; SOGoMailIdentity *identity; @@ -410,7 +417,8 @@ static NSArray *infoKeys = nil; return sentFolder; } -- (NSException *)storeMailInSentFolder:(NSString *)_path { +- (NSException *) storeMailInSentFolder: (NSString *) _path +{ SOGoMailFolder *folder; NSData *data; id result; @@ -523,7 +531,8 @@ static NSArray *infoKeys = nil; return success; } -- (id)failedToSaveFormResponse { +- (id) failedToSaveFormResponse +{ // TODO: improve error handling return [NSException exceptionWithHTTPStatus:500 /* server error */ reason:@"failed to store draft object on server!"]; @@ -531,7 +540,8 @@ static NSArray *infoKeys = nil; /* attachment helper */ -- (NSArray *)attachmentNames { +- (NSArray *) attachmentNames +{ NSArray *a; if (attachmentNames != nil) @@ -542,7 +552,9 @@ static NSArray *infoKeys = nil; attachmentNames = [a copy]; return attachmentNames; } -- (BOOL)hasAttachments { + +- (BOOL) hasAttachments +{ return [[self attachmentNames] count] > 0 ? YES : NO; } @@ -558,11 +570,13 @@ static NSArray *infoKeys = nil; return self; } -- (id)saveAction { +- (id) saveAction +{ return [self _saveFormInfo] ? self : [self failedToSaveFormResponse]; } -- (NSException *)validateForSend { +- (NSException *) validateForSend +{ // TODO: localize errors if (![self hasOneOrMoreRecipients]) { @@ -646,7 +660,8 @@ static NSArray *infoKeys = nil; return result; } -- (id)deleteAction { +- (id) deleteAction +{ NSException *error; id page;