pull/42/head
Ludovic Marcotte 2014-06-11 12:55:51 -04:00
parent ce07695a55
commit e7ddfb0546
2 changed files with 37 additions and 9 deletions

View File

@ -1899,9 +1899,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
value = [theDocumentElement getElementsByTagName: @"ReplaceMime"];
// ReplaceMime isn't specified so we must NOT use the server copy
// ReplaceMime IS specified so we must NOT use the server copy
// but rather take the data as-is from the client.
if (![value count])
if ([value count])
{
[self processSendMail: theDocumentElement
inResponse: theResponse];
@ -1921,11 +1921,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
NSData *data;
NGMimeMessageGenerator *generator;
NGMimeBodyPart *bodyPart;
NGMimeBodyPart *bodyPart;
NGMutableHashMap *map;
NGMimeFileData *fdata;
NSException *error;
id body;
id body, bodyFromSmartForward;
userFolder = [[context activeUser] homeFolderInContext: context];
accountsFolder = [userFolder lookupName: @"Mail" inContext: context acquire: NO];
@ -1941,10 +1942,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
parser = [[NGMimeMessageParser alloc] init];
data = [[[[(id)[theDocumentElement getElementsByTagName: @"MIME"] lastObject] textValue] stringByDecodingBase64] dataUsingEncoding: NSUTF8StringEncoding];
messageFromSmartForward = [parser parsePartFromData: data];
RELEASE(parser);
// We create a new MIME multipart/mixed message. The first part will be the text part
// of our "smart forward" and the second part will be the message/rfc822 part of the
// "smart forwarded" message.
@ -1954,11 +1953,39 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
body = [[[NGMimeMultipartBody alloc] initWithPart: messageToSend] autorelease];
// First part
// First part - either a text/* or a multipart/*. If it's a multipart,
// we take the first part text/* part we see.
map = [[[NGMutableHashMap alloc] initWithCapacity: 1] autorelease];
[map setObject: @"text/plain" forKey: @"content-type"];
bodyFromSmartForward = nil;
if ([[messageFromSmartForward body] isKindOfClass: [NGMimeMultipartBody class]])
{
NGMimeBodyPart *part;
NSArray *parts;
int i;
parts = [[messageFromSmartForward body] parts];
for (i = 0; i < [parts count]; i++)
{
part = [parts objectAtIndex: i];
if ([[[part contentType] type] isEqualToString: @"text"])
{
[map setObject: [[part contentType] stringValue] forKey: @"content-type"];
bodyFromSmartForward = [part body];
break;
}
}
}
else
{
[map setObject: [[messageFromSmartForward contentType] stringValue] forKey: @"content-type"];
bodyFromSmartForward = [messageFromSmartForward body];
}
bodyPart = [[[NGMimeBodyPart alloc] initWithHeader:map] autorelease];
[bodyPart setBody: [messageFromSmartForward body]];
[bodyPart setBody: bodyFromSmartForward];
[body addBodyPart: bodyPart];
// Second part

1
NEWS
View File

@ -10,6 +10,7 @@ Bug fixes
- better handling of empty "Flag" messages over ActiveSync (#2806)
- fixed Chinese charset handling (#2809)
- fixed folder name (calendars and contacts) of new subscriptions (#2801)
- fixed the reply/forward operation over ActiveSync (#2805)
2.2.5 (2014-06-05)
------------------