diff --git a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m index 41398c71c..35ddad8ce 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher+Sync.m +++ b/ActiveSync/SOGoActiveSyncDispatcher+Sync.m @@ -451,6 +451,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. withFilterType: (NSCalendarDate *) theFilterType inBuffer: (NSMutableString *) theBuffer { + NSMutableString *s; int i; // @@ -460,7 +461,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ([theSyncKey isEqualToString: [theCollection davCollectionTag]]) return; - [theBuffer appendString: @""]; + s = [NSMutableString string]; switch (theFolderType) { @@ -498,9 +499,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if (deleted) { - [theBuffer appendString: @""]; - [theBuffer appendFormat: @"%@", uid]; - [theBuffer appendString: @""]; + [s appendString: @""]; + [s appendFormat: @"%@", uid]; + [s appendString: @""]; } else { @@ -510,12 +511,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. updated = NO; if (updated) - [theBuffer appendString: @""]; + [s appendString: @""]; else - [theBuffer appendString: @""]; + [s appendString: @""]; - [theBuffer appendFormat: @"%@", uid]; - [theBuffer appendString: @""]; + [s appendFormat: @"%@", uid]; + [s appendString: @""]; sogoObject = [theCollection lookupName: uid inContext: context @@ -526,14 +527,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. else componentObject = [sogoObject component: NO secure: NO]; - [theBuffer appendString: [componentObject activeSyncRepresentation]]; + [s appendString: [componentObject activeSyncRepresentation]]; - [theBuffer appendString: @""]; + [s appendString: @""]; if (updated) - [theBuffer appendString: @""]; + [s appendString: @""]; else - [theBuffer appendString: @""]; + [s appendString: @""]; } } // for ... } @@ -557,30 +558,30 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ([command isEqualToString: @"deleted"]) { - [theBuffer appendString: @""]; - [theBuffer appendFormat: @"%@", uid]; - [theBuffer appendString: @""]; + [s appendString: @""]; + [s appendFormat: @"%@", uid]; + [s appendString: @""]; } else { if ([command isEqualToString: @"added"]) - [theBuffer appendString: @""]; + [s appendString: @""]; else - [theBuffer appendString: @""]; + [s appendString: @""]; mailObject = [theCollection lookupName: uid inContext: context acquire: 0]; - [theBuffer appendFormat: @"%@", uid]; - [theBuffer appendString: @""]; - [theBuffer appendString: [mailObject activeSyncRepresentation]]; - [theBuffer appendString: @""]; + [s appendFormat: @"%@", uid]; + [s appendString: @""]; + [s appendString: [mailObject activeSyncRepresentation]]; + [s appendString: @""]; if ([command isEqualToString: @"added"]) - [theBuffer appendString: @""]; + [s appendString: @""]; else - [theBuffer appendString: @""]; + [s appendString: @""]; } } @@ -588,7 +589,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. break; } // switch (folderType) ... - [theBuffer appendString: @""]; + if ([s length]) + { + [theBuffer appendString: @""]; + [theBuffer appendString: s]; + [theBuffer appendString: @""]; + } } // @@ -709,6 +715,16 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [theBuffer appendString: @""]; + + if (folderType == ActiveSyncMailFolder) + [theBuffer appendString: @"Email"]; + else if (folderType == ActiveSyncContactFolder) + [theBuffer appendString: @"Contacts"]; + else if (folderType == ActiveSyncEventFolder) + [theBuffer appendString: @"Calendar"]; + else if (folderType == ActiveSyncTaskFolder) + [theBuffer appendString: @"Tasks"]; + [theBuffer appendFormat: @"%@", davCollectionTag]; [theBuffer appendFormat: @"%@", collectionId]; [theBuffer appendFormat: @"%d", 1];