mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-03 06:02:17 +00:00
see changelog
Monotone-Parent: 9abbb51cbabcad645190865841814453369fa85f Monotone-Revision: 92ce389a1151c9f1a5f222e3ad03a757f3be2bdd Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2007-11-19T00:47:07 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
2007-11-18 Ludovic Marcotte <ludovic@inverse.ca>
|
||||
|
||||
* SoObjects/Mailer/SOGoMailBodyPart.m
|
||||
SoObjects/Mailer/SOGoMailObject.m
|
||||
UI/MailPartViewers/UIxMailPartViewer.m
|
||||
Added support of messages containing non-textual
|
||||
content and no parts.
|
||||
|
||||
* UI/MailerUI/UIxMailView.m
|
||||
SoObjects/Mailer/SOGoMailObject.m
|
||||
UI/Templates/MailerUI/UIxMailView.wox
|
||||
Added support for the Reply-To header upon
|
||||
message display.
|
||||
|
||||
2007-11-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Scheduler/UIxTaskEditor.m ([UIxTaskEditor -saveAction]):
|
||||
|
||||
@@ -179,17 +179,25 @@ static BOOL debugOn = NO;
|
||||
if (data == nil) return nil;
|
||||
|
||||
/* check for content encodings */
|
||||
|
||||
if ((enc = [[self partInfo] valueForKey:@"encoding"]) != nil) {
|
||||
enc = [enc uppercaseString];
|
||||
|
||||
if ([enc isEqualToString:@"BASE64"])
|
||||
data = [data dataByDecodingBase64];
|
||||
else if ([enc isEqualToString:@"7BIT"])
|
||||
; /* keep data as is */ // TODO: do we need to change encodings?
|
||||
else
|
||||
[self errorWithFormat:@"unsupported encoding: %@", enc];
|
||||
}
|
||||
enc = [[self partInfo] valueForKey: @"encoding"];
|
||||
|
||||
/* if we haven't found one, check out the main message's encoding
|
||||
as we could be trying to fetch the message's content as a part */
|
||||
if (!enc)
|
||||
enc = [[[[self mailObject] fetchCoreInfos] valueForKey: @"body"]
|
||||
valueForKey: @"encoding"];
|
||||
|
||||
if (enc)
|
||||
{
|
||||
enc = [enc uppercaseString];
|
||||
|
||||
if ([enc isEqualToString:@"BASE64"])
|
||||
data = [data dataByDecodingBase64];
|
||||
else if ([enc isEqualToString:@"7BIT"])
|
||||
; /* keep data as is */ // TODO: do we need to change encodings?
|
||||
else
|
||||
[self errorWithFormat:@"unsupported encoding: %@", enc];
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -296,6 +296,11 @@ static BOOL debugSoParts = NO;
|
||||
return [[self envelope] cc];
|
||||
}
|
||||
|
||||
- (NSArray *) replyToEnvelopeAddresses
|
||||
{
|
||||
return [[self envelope] replyTo];
|
||||
}
|
||||
|
||||
- (NSData *) mailHeaderData
|
||||
{
|
||||
return [[self fetchCoreInfos] valueForKey: @"header"];
|
||||
@@ -460,6 +465,7 @@ static BOOL debugSoParts = NO;
|
||||
{
|
||||
if ([content isKindOfClass: [NSData class]])
|
||||
{
|
||||
#warning we ignore the charset here?
|
||||
s = [[NSString alloc] initWithData: content
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
if (s)
|
||||
@@ -747,6 +753,14 @@ static BOOL debugSoParts = NO;
|
||||
NSString *mimeType;
|
||||
|
||||
parts = [[self bodyStructure] objectForKey: @"parts"];
|
||||
|
||||
/* We don't have parts here but we're trying to download the message's
|
||||
content that could be an image/jpeg, as an example */
|
||||
if ([parts count] == 0)
|
||||
{
|
||||
return [SOGoMailBodyPart objectWithName: @"1" inContainer: self];
|
||||
}
|
||||
|
||||
part = [_key intValue] - 1;
|
||||
if (part > -1 && part < [parts count])
|
||||
{
|
||||
|
||||
@@ -312,9 +312,16 @@
|
||||
if (![url hasSuffix: @"/"])
|
||||
url = [url stringByAppendingString: @"/"];
|
||||
|
||||
/* mail relative path to body-part */
|
||||
|
||||
/* eg this was nil for a draft containing an HTML message */
|
||||
/* if we get a message with an image/* or applicatio/*
|
||||
Content-Type, we must generate a 'fake' part since our
|
||||
decoded mail won't have any. Also see SOGoMailBodyPart: -fetchBLOB
|
||||
and SOGoMailObject: -lookupImap4BodyPartKey: inContext for
|
||||
other workarounds */
|
||||
if (!partPath || [partPath count] == 0)
|
||||
partPath = [NSArray arrayWithObject: @"0"];
|
||||
|
||||
/* mail relative path to body-part
|
||||
eg this was nil for a draft containing an HTML message */
|
||||
if ([(n = [partPath componentsJoinedByString:@"/"]) isNotNull])
|
||||
url = [url stringByAppendingString:n];
|
||||
|
||||
|
||||
@@ -131,6 +131,11 @@ static NSString *mailETag = nil;
|
||||
return [[[self clientObject] ccEnvelopeAddresses] count] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
- (BOOL) hasReplyTo
|
||||
{
|
||||
return [[[self clientObject] replyToEnvelopeAddresses] count] > 0 ? YES : NO;
|
||||
}
|
||||
|
||||
/* viewers */
|
||||
|
||||
- (id) contentViewerComponent
|
||||
|
||||
@@ -66,6 +66,20 @@
|
||||
</td>
|
||||
</tr>
|
||||
</var:if>
|
||||
<var:if condition="hasReplyTo">
|
||||
<tr class="mailer_fieldrow">
|
||||
<td class="mailer_fieldname"><var:string label:value="Reply-To"/>:</td>
|
||||
<td class="mailer_fieldvalue">
|
||||
<var:foreach list="clientObject.replyToEnvelopeAddresses"
|
||||
item="currentAddress">
|
||||
<a var:href="currentAddressLink"
|
||||
><var:string value="currentAddress"
|
||||
formatter="context.mailEnvelopeFullAddressFormatter"
|
||||
/></a>
|
||||
</var:foreach>
|
||||
</td>
|
||||
</tr>
|
||||
</var:if>
|
||||
</table>
|
||||
|
||||
<div class="mailer_mailcontent">
|
||||
|
||||
Reference in New Issue
Block a user