mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 23:07:12 +00:00
* SoObjects/Mailer/SOGoMailForward.m (from, to, cc, reply-to):
mailHeaders returns an array if there are multiple headers of the same type. Handle this case to correctly show multiple from, to, cc and reply-to headers in mail replies/forwards instead of crashing. Monotone-Parent: dac25405c6ab2f1d735ddb9f6db4243e5e96d14b Monotone-Revision: 29aefdeb26834742b8cd9f01120573b4dcbcc7ed Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-07-12T16:47:23
This commit is contained in:
1 parent
825686eaed
commit
ef848303a3
3 files changed
+32
-17
No files matched your search
@@ -89,13 +89,13 @@
|
||||
|
||||
- (NSString *) from
|
||||
{
|
||||
NSString *rc;
|
||||
id rc;
|
||||
|
||||
rc = [[sourceMail mailHeaders] objectForKey: @"from"];
|
||||
if ([rc isKindOfClass: [NSArray class]])
|
||||
rc = [rc componentsJoinedByString: @", "];
|
||||
if (htmlComposition)
|
||||
rc = [[[sourceMail mailHeaders] objectForKey: @"from"]
|
||||
stringByEscapingHTMLString];
|
||||
else
|
||||
rc = [[sourceMail mailHeaders] objectForKey: @"from"];
|
||||
rc = [rc stringByEscapingHTMLString];
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -119,13 +119,16 @@
|
||||
|
||||
- (NSString *) replyTo
|
||||
{
|
||||
NSString *rc;
|
||||
id rc;
|
||||
|
||||
rc = [self _headerField: @"reply-to"];
|
||||
if ([rc isKindOfClass: [NSArray class]])
|
||||
rc = [rc componentsJoinedByString: @", "];
|
||||
if (htmlComposition)
|
||||
rc = [NSString stringWithFormat: @"%@<br/>",
|
||||
[[self _headerField: @"reply-to"] stringByEscapingHTMLString]];
|
||||
[rc stringByEscapingHTMLString]];
|
||||
else
|
||||
rc = ([NSString stringWithFormat: @"%@\n", [self _headerField: @"reply-to"]]);
|
||||
rc = ([NSString stringWithFormat: @"%@\n", rc]);
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -149,12 +152,13 @@
|
||||
|
||||
- (NSString *) to
|
||||
{
|
||||
NSString *rc;
|
||||
id rc;
|
||||
|
||||
rc = [self _headerField: @"to"];
|
||||
if ([rc isKindOfClass: [NSArray class]])
|
||||
rc = [rc componentsJoinedByString: @", "];
|
||||
if (htmlComposition)
|
||||
rc = [[[sourceMail mailHeaders] objectForKey: @"to"] stringByEscapingHTMLString];
|
||||
else
|
||||
rc = [[sourceMail mailHeaders] objectForKey: @"to"];
|
||||
rc = [rc stringByEscapingHTMLString];
|
||||
|
||||
return rc;
|
||||
}
|
||||
@@ -166,13 +170,17 @@
|
||||
|
||||
- (NSString *) cc
|
||||
{
|
||||
NSString *rc;
|
||||
id *rc;
|
||||
|
||||
rc = [self _headerField: @"cc"];
|
||||
if ([rc isKindOfClass: [NSArray class]])
|
||||
rc = [rc componentsJoinedByString: @", "];
|
||||
|
||||
if (htmlComposition)
|
||||
rc = [NSString stringWithFormat: @"%@<br/>",
|
||||
[[self _headerField: @"cc"] stringByEscapingHTMLString]];
|
||||
[rc stringByEscapingHTMLString]];
|
||||
else
|
||||
rc = ([NSString stringWithFormat: @"%@\n", [self _headerField: @"cc"]]);
|
||||
rc = [NSString stringWithFormat: @"%@\n", rc];
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user