From 265e582fb0b55f28004163f7958b5c742e77fdb3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 22 Dec 2006 17:07:15 +0000 Subject: [PATCH] Monotone-Parent: d7e6aefd1b9108964b5b73aaa4990bf5dc4c6066 Monotone-Revision: a3b4583a95b88223d1e19194a62af3dee02ca608 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-22T17:07:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 ++++ UI/MailerUI/UIxMailMainFrame.m | 52 ++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/ChangeLog b/ChangeLog index ddbdbbef6..c532738db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-12-22 Wolfgang Sourdeau + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame + -composeAction]): method imported from removed container modules. + ([UIxMailMainFrame -mailFolderName]): method imported from removed + container modules. + * UI/MailerUI/UIxMailPopupView.m: a new special popup component for wrapping UIxMailView with the "popupview" action. diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index d15e4cbfa..c9063d6e8 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -19,6 +19,7 @@ 02111-1307, USA. */ +#import #import #import "UIxMailMainFrame.h" @@ -183,4 +184,55 @@ static NSString *treeRootClassName = nil; @"", errorText]; } +/* FIXME: migrated methods which might not work yet... */ +#warning check this +- (NSString *) mailFolderName +{ + NSMutableArray *mailboxes; + SOGoMailObject *currentObject; + + mailboxes = [NSMutableArray new]; + [mailboxes autorelease]; + + currentObject = [self clientObject]; + while (![currentObject isKindOfClass: [SOGoMailAccounts class]]) + { + [mailboxes insertObject: [currentObject nameInContainer] atIndex: 0]; + currentObject = [currentObject container]; + } + + return [NSString stringWithFormat: @"/%@", + [mailboxes componentsJoinedByString: @"/"]]; +} + +- (id) composeAction +{ + NSArray *c; + NSString *inbox, *url, *parameter; + NSMutableDictionary *urlParams; + id actionResult; + + c = [[self clientObject] toManyRelationshipKeys]; + if ([c count] > 0) + { + urlParams = [NSMutableDictionary new]; + [urlParams autorelease]; + + parameter = [self queryParameterForKey: @"mailto"]; + if (parameter) + [urlParams setObject: parameter + forKey: @"mailto"]; + inbox = [NSString stringWithFormat: @"%@/INBOX", + [c objectAtIndex: 0]]; + url = [inbox composeURLWithAction: @"compose" + parameters: urlParams + andHash: NO]; + actionResult = [self redirectToLocation: url]; + } + else + actionResult = self; + + return actionResult; +} + @end /* UIxMailMainFrame */