From c4d707b4add4a7284cb4a9263657792b8b165481 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 30 Jul 2007 18:40:25 +0000 Subject: [PATCH] Monotone-Parent: 7d0ca861b776cb009eb7120a75102f92944c061d Monotone-Revision: 52f687d98500bc08f60cc06fd43aa7e73d13f262 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-30T18:40:25 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailView.m | 56 +++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/UI/MailerUI/UIxMailView.m b/UI/MailerUI/UIxMailView.m index ecd299dbe..a8c01a0bc 100644 --- a/UI/MailerUI/UIxMailView.m +++ b/UI/MailerUI/UIxMailView.m @@ -102,33 +102,39 @@ static NSString *mailETag = nil; /* links (DUP to UIxMailPartViewer!) */ -- (NSString *)linkToEnvelopeAddress:(NGImap4EnvelopeAddress *)_address { +- (NSString *) linkToEnvelopeAddress: (NGImap4EnvelopeAddress *) _address +{ // TODO: make some web-link, eg open a new compose panel? - return [@"mailto:" stringByAppendingString:[_address baseEMail]]; + return [NSString stringWithFormat: @"mailto: %@", [_address baseEMail]]; } -- (NSString *)currentAddressLink { +- (NSString *) currentAddressLink +{ return [self linkToEnvelopeAddress:[self currentAddress]]; } /* fetching */ -- (id)message { +- (id) message +{ return [[self clientObject] fetchCoreInfos]; } -- (BOOL)hasCC { +- (BOOL) hasCC +{ return [[[self clientObject] ccEnvelopeAddresses] count] > 0 ? YES : NO; } /* viewers */ -- (id)contentViewerComponent { +- (id) contentViewerComponent +{ // TODO: I would prefer to flatten the body structure prior rendering, // using some delegate to decide which parts to select for alternative. id info; info = [[self clientObject] bodyStructure]; + return [[context mailRenderingContext] viewerForBodyInfo:info]; } @@ -171,21 +177,27 @@ static NSString *mailETag = nil; return self; } -- (BOOL)isDeletableClientObject { - return [[self clientObject] respondsToSelector:@selector(delete)]; +- (BOOL) isDeletableClientObject +{ + return [[self clientObject] respondsToSelector: @selector (delete)]; } -- (BOOL)isInlineViewer { + +- (BOOL) isInlineViewer +{ return NO; } -- (id)redirectToParentFolder { +- (id) redirectToParentFolder +{ id url; - url = [[[self clientObject] container] baseURLInContext:context]; - return [self redirectToLocation:url]; + url = [[[self clientObject] container] baseURLInContext: context]; + + return [self redirectToLocation: url]; } -- (id)deleteAction { +- (id) deleteAction +{ NSException *ex; if (![self isDeletableClientObject]) { @@ -220,7 +232,8 @@ static NSString *mailETag = nil; return [self redirectToParentFolder]; } -- (id)trashAction { +- (id) trashAction +{ NSException *ex; if ([self isInvokedBySafeMethod]) { @@ -298,18 +311,21 @@ static NSString *mailETag = nil; /* generating response */ -- (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx { +- (void) appendToResponse: (WOResponse *) _response + inContext: (WOContext *) _ctx +{ UIxMailRenderingContext *mctx; if (mailETag != nil) [[_ctx response] setHeader:mailETag forKey:@"etag"]; - mctx = [[NSClassFromString(@"UIxMailRenderingContext") - alloc] initWithViewer:self context:_ctx]; - [_ctx pushMailRenderingContext:mctx]; + mctx = [[UIxMailRenderingContext alloc] initWithViewer: self + context: _ctx]; + + [_ctx pushMailRenderingContext: mctx]; [mctx release]; - - [super appendToResponse:_response inContext:_ctx]; + + [super appendToResponse: _response inContext: _ctx]; [[_ctx popMailRenderingContext] reset]; }