(fix) fixed EAS conversation ID issues on BB10 (#3152)
parent
731264d9dc
commit
a8ab01a5eb
|
@ -2576,7 +2576,7 @@ static BOOL debugOn = NO;
|
||||||
NGMimeFileData *fdata;
|
NGMimeFileData *fdata;
|
||||||
NSException *error;
|
NSException *error;
|
||||||
NSArray *attachmentKeys;
|
NSArray *attachmentKeys;
|
||||||
NSMutableArray *attachments;
|
NSMutableArray *attachments, *references;
|
||||||
|
|
||||||
id body, bodyFromSmartForward, htmlPart, textPart;
|
id body, bodyFromSmartForward, htmlPart, textPart;
|
||||||
NSString *fullName, *email, *charset, *s;
|
NSString *fullName, *email, *charset, *s;
|
||||||
|
@ -2615,7 +2615,25 @@ static BOOL debugOn = NO;
|
||||||
[map setObject: email forKey: @"from"];
|
[map setObject: email forKey: @"from"];
|
||||||
|
|
||||||
if ([mailObject messageId])
|
if ([mailObject messageId])
|
||||||
[map setObject: [mailObject messageId] forKey: @"in-reply-to"];
|
{
|
||||||
|
[map setObject: [mailObject messageId] forKey: @"in-reply-to"];
|
||||||
|
|
||||||
|
references = [[[[[mailObject mailHeaders] objectForKey: @"references"] componentsSeparatedByString: @" "] mutableCopy] autorelease];
|
||||||
|
if ([references count] > 0)
|
||||||
|
{
|
||||||
|
// If there are more than ten identifiers listed, we eliminate the second one.
|
||||||
|
if ([references count] >= 10)
|
||||||
|
[references removeObjectAtIndex: 1];
|
||||||
|
|
||||||
|
[references addObject: [mailObject messageId]];
|
||||||
|
|
||||||
|
[map setObject: [references componentsJoinedByString:@" "] forKey: @"references"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
[map setObject: [mailObject messageId] forKey: @"references"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
|
messageToSend = [[[NGMimeMessage alloc] initWithHeader: map] autorelease];
|
||||||
body = [[[NGMimeMultipartBody alloc] initWithPart: messageToSend] autorelease];
|
body = [[[NGMimeMultipartBody alloc] initWithPart: messageToSend] autorelease];
|
||||||
|
|
|
@ -550,6 +550,28 @@ struct GlobalObjectId {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (NSString *) _getNormalizedSubject
|
||||||
|
{
|
||||||
|
NSString *subject;
|
||||||
|
NSUInteger colIdx;
|
||||||
|
NSString *stringValue;
|
||||||
|
|
||||||
|
subject = [[self subject] decodedHeader];
|
||||||
|
|
||||||
|
colIdx = [subject rangeOfString: @":" options:NSBackwardsSearch].location;
|
||||||
|
if (colIdx != NSNotFound && colIdx + 1 < [subject length])
|
||||||
|
stringValue = [[subject substringFromIndex: colIdx + 1] stringByTrimmingLeadSpaces];
|
||||||
|
else
|
||||||
|
stringValue = subject;
|
||||||
|
|
||||||
|
if (!stringValue)
|
||||||
|
stringValue = @"";
|
||||||
|
|
||||||
|
return stringValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -663,7 +685,7 @@ struct GlobalObjectId {
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
[s appendFormat: @"<Subject xmlns=\"Email:\">%@</Subject>", [value activeSyncRepresentationInContext: context]];
|
[s appendFormat: @"<Subject xmlns=\"Email:\">%@</Subject>", [value activeSyncRepresentationInContext: context]];
|
||||||
[s appendFormat: @"<ThreadTopic xmlns=\"Email:\">%@</ThreadTopic>", [value activeSyncRepresentationInContext: context]];
|
[s appendFormat: @"<ThreadTopic xmlns=\"Email:\">%@</ThreadTopic>", [[self _getNormalizedSubject] activeSyncRepresentationInContext: context]];
|
||||||
}
|
}
|
||||||
|
|
||||||
// DateReceived
|
// DateReceived
|
||||||
|
@ -1049,7 +1071,13 @@ struct GlobalObjectId {
|
||||||
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.0"] ||
|
if ([[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.0"] ||
|
||||||
[[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
|
[[[context request] headerForKey: @"MS-ASProtocolVersion"] isEqualToString: @"14.1"])
|
||||||
{
|
{
|
||||||
if ([self inReplyTo])
|
NSString *reference;
|
||||||
|
|
||||||
|
reference = [[[[self mailHeaders] objectForKey: @"references"] componentsSeparatedByString: @" "] objectAtIndex: 0];
|
||||||
|
|
||||||
|
if ([reference length] > 0)
|
||||||
|
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[reference dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
|
||||||
|
else if ([self inReplyTo])
|
||||||
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self inReplyTo] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
|
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self inReplyTo] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
|
||||||
else if ([self messageId])
|
else if ([self messageId])
|
||||||
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self messageId] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
|
[s appendFormat: @"<ConversationId xmlns=\"Email2:\">%@</ConversationId>", [[[self messageId] dataUsingEncoding: NSUTF8StringEncoding] activeSyncRepresentationInContext: context]];
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -20,6 +20,7 @@ Bug fixes
|
||||||
- Android EAS Lollipop fixes (#3268 and #3269)
|
- Android EAS Lollipop fixes (#3268 and #3269)
|
||||||
- improved EAS email flagging handling (#3140)
|
- improved EAS email flagging handling (#3140)
|
||||||
- fixed computation of GlobalObjectId (#3235)
|
- fixed computation of GlobalObjectId (#3235)
|
||||||
|
- fixed EAS conversation ID issues on BB10 (#3152)
|
||||||
|
|
||||||
2.3.0 (2015-06-01)
|
2.3.0 (2015-06-01)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
Loading…
Reference in New Issue