mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-28 17:57:38 +00:00
Applied patch from bug #2810
This commit is contained in:
@@ -238,6 +238,8 @@ struct GlobalObjectId {
|
|||||||
|
|
||||||
if (key)
|
if (key)
|
||||||
{
|
{
|
||||||
|
NSString *s, *charset;
|
||||||
|
|
||||||
d = [[self fetchPlainTextParts] objectForKey: key];
|
d = [[self fetchPlainTextParts] objectForKey: key];
|
||||||
|
|
||||||
encoding = [[self lookupInfoForBodyPart: key] objectForKey: @"encoding"];
|
encoding = [[self lookupInfoForBodyPart: key] objectForKey: @"encoding"];
|
||||||
@@ -246,6 +248,14 @@ struct GlobalObjectId {
|
|||||||
d = [d dataByDecodingBase64];
|
d = [d dataByDecodingBase64];
|
||||||
else if ([encoding caseInsensitiveCompare: @"quoted-printable"] == NSOrderedSame)
|
else if ([encoding caseInsensitiveCompare: @"quoted-printable"] == NSOrderedSame)
|
||||||
d = [d dataByDecodingQuotedPrintableTransferEncoding];
|
d = [d dataByDecodingQuotedPrintableTransferEncoding];
|
||||||
|
|
||||||
|
charset = [[[self lookupInfoForBodyPart: key] objectForKey: @"parameterList"] objectForKey: @"charset"];
|
||||||
|
|
||||||
|
if (![charset length])
|
||||||
|
charset = @"us-ascii";
|
||||||
|
|
||||||
|
s = [NSString stringWithData: d usingEncodingNamed: charset];
|
||||||
|
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
@@ -296,13 +306,13 @@ struct GlobalObjectId {
|
|||||||
if ([body isKindOfClass: [NSData class]])
|
if ([body isKindOfClass: [NSData class]])
|
||||||
{
|
{
|
||||||
NSString *charset;
|
NSString *charset;
|
||||||
int encoding;
|
|
||||||
|
|
||||||
charset = [[thePart contentType] valueOfParameter: @"charset"];
|
charset = [[thePart contentType] valueOfParameter: @"charset"];
|
||||||
encoding = [NGMimeType stringEncodingForCharset: charset];
|
|
||||||
|
|
||||||
s = [[NSString alloc] initWithData: body encoding: encoding];
|
if (![charset length])
|
||||||
AUTORELEASE(s);
|
charset = @"us-ascii";
|
||||||
|
|
||||||
|
s = [NSString stringWithData: body usingEncodingNamed: charset];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -396,6 +406,13 @@ struct GlobalObjectId {
|
|||||||
{
|
{
|
||||||
if ([type isEqualToString: @"text"])
|
if ([type isEqualToString: @"text"])
|
||||||
{
|
{
|
||||||
|
NSString *s, *charset;
|
||||||
|
|
||||||
|
charset = [[[self lookupInfoForBodyPart: @""] objectForKey: @"parameterList"] objectForKey: @"charset"];
|
||||||
|
|
||||||
|
if (![charset length])
|
||||||
|
charset = @"us-ascii";
|
||||||
|
|
||||||
d = [[self fetchPlainTextParts] objectForKey: @""];
|
d = [[self fetchPlainTextParts] objectForKey: @""];
|
||||||
|
|
||||||
// We check if we have base64 encoded parts. If so, we just
|
// We check if we have base64 encoded parts. If so, we just
|
||||||
@@ -407,17 +424,15 @@ struct GlobalObjectId {
|
|||||||
else if ([encoding caseInsensitiveCompare: @"quoted-printable"] == NSOrderedSame)
|
else if ([encoding caseInsensitiveCompare: @"quoted-printable"] == NSOrderedSame)
|
||||||
d = [d dataByDecodingQuotedPrintableTransferEncoding];
|
d = [d dataByDecodingQuotedPrintableTransferEncoding];
|
||||||
|
|
||||||
|
s = [NSString stringWithData: d usingEncodingNamed: charset];
|
||||||
|
|
||||||
// Check if we must convert html->plain
|
// Check if we must convert html->plain
|
||||||
if (theType == 1 && [subtype isEqualToString: @"html"])
|
if (theType == 1 && [subtype isEqualToString: @"html"])
|
||||||
{
|
{
|
||||||
NSString *s;
|
|
||||||
|
|
||||||
s = [[NSString alloc] initWithData: d encoding: NSUTF8StringEncoding];
|
|
||||||
AUTORELEASE(s);
|
|
||||||
|
|
||||||
s = [s htmlToText];
|
s = [s htmlToText];
|
||||||
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
d = [s dataUsingEncoding: NSUTF8StringEncoding];
|
||||||
}
|
}
|
||||||
else if ([type isEqualToString: @"multipart"])
|
else if ([type isEqualToString: @"multipart"])
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ Bug fixes
|
|||||||
- avoid raising exceptions when the db is down and we try to access the preferences module (#2813)
|
- avoid raising exceptions when the db is down and we try to access the preferences module (#2813)
|
||||||
- we now ignore the SCHEDULE-AGENT property when Thunderbird/Ligthning sends it to avoid
|
- we now ignore the SCHEDULE-AGENT property when Thunderbird/Ligthning sends it to avoid
|
||||||
not-generating invitation responses for externally received IMIP messages
|
not-generating invitation responses for externally received IMIP messages
|
||||||
|
- improved charset handling over ActiveSync (#2810)
|
||||||
|
|
||||||
2.2.5 (2014-06-05)
|
2.2.5 (2014-06-05)
|
||||||
------------------
|
------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user