diff --git a/ActiveSync/NSString+ActiveSync.h b/ActiveSync/NSString+ActiveSync.h index 172d71eb1..4aad558a2 100644 --- a/ActiveSync/NSString+ActiveSync.h +++ b/ActiveSync/NSString+ActiveSync.h @@ -49,6 +49,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - (NSString *) deviceType; - (NSString *) attachmentName; - (NSString *) command; +- (NSString *) collectionid; +- (NSString *) itemid; - (NSData *) convertHexStringToBytes; @end diff --git a/ActiveSync/NSString+ActiveSync.m b/ActiveSync/NSString+ActiveSync.m index 01f593352..6aa054d10 100644 --- a/ActiveSync/NSString+ActiveSync.m +++ b/ActiveSync/NSString+ActiveSync.m @@ -298,6 +298,31 @@ static NSArray *easCommandParameters = nil; return s; } +- (NSString *) itemid +{ + NSString *s; + + s = [self _valueForParameter: @"ITEMID="]; + + if (!s) + s = @"Unknown"; + + return s; +} + +- (NSString *) collectionid +{ + NSString *s; + + s = [self _valueForParameter: @"COLLECTIONID="]; + + if (!s) + s = @"Unknown"; + + return s; +} + + // // FIXME: combine with our OpenChange code. // diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index fb9b535ef..0b481132a 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -2364,7 +2364,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. id value; folderId = [[(id)[theDocumentElement getElementsByTagName: @"FolderId"] lastObject] textValue]; + + // if folderId is not there try to get it from URL + if (!folderId) + { + folderId = [[[context request] uri] collectionid]; + } + itemId = [[(id)[theDocumentElement getElementsByTagName: @"ItemId"] lastObject] textValue]; + + // if itemId is not there try to get it from URL + if (!itemId) + { + itemId = [[[context request] uri] itemid]; + } + realCollectionId = [folderId realCollectionIdWithFolderType: &folderType]; realCollectionId = [self globallyUniqueIDToIMAPFolderName: realCollectionId type: folderType]; @@ -2562,7 +2576,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // If the MS-ASProtocolVersion header is set to "12.1", the body of the SendMail request is // is a "message/rfc822" payload - otherwise, it's a WBXML blob. // - if ([cmdName caseInsensitiveCompare: @"SendMail"] == NSOrderedSame || + if (([cmdName caseInsensitiveCompare: @"SendMail"] == NSOrderedSame || + [cmdName caseInsensitiveCompare: @"SmartReply"] == NSOrderedSame || + [cmdName caseInsensitiveCompare: @"SmartForward"] == NSOrderedSame) && [[theRequest headerForKey: @"content-type"] caseInsensitiveCompare: @"message/rfc822"] == NSOrderedSame) { NSString *s, *xml; @@ -2580,7 +2596,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. s = [theRequest contentAsString]; } - xml = [NSString stringWithFormat: @"%@", [s stringByEncodingBase64]]; + xml = [NSString stringWithFormat: @"<%@ xmlns=\"ComposeMail:\">%@", cmdName, [s stringByEncodingBase64], cmdName]; + d = [xml dataUsingEncoding: NSASCIIStringEncoding]; diff --git a/NEWS b/NEWS index a20444205..87c1e1c18 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ Bug fixes - use the correct mail body element for EAS 2.5 clients - fixed tasks disappearing issue with RoadSync - use the correct body element for events for EAS 2.5 clients + - SmartReply improvements for missing body attributes 2.2.16 (2015-02-12) -------------------