(fix) improve FolderSync operation (fixes #4672)

This commit is contained in:
Ludovic Marcotte
2019-09-13 09:45:48 -04:00
committed by leecher1337
parent 671857fd19
commit bd6bdcb136
2 changed files with 43 additions and 7 deletions

View File

@@ -831,7 +831,7 @@ void handle_eas_terminate(int signum)
- (void) processFolderSync: (id <DOMElement>) theDocumentElement
inResponse: (WOResponse *) theResponse
{
NSString *key, *cKey, *nkey, *name, *serverId, *parentId, *nameInCache, *personalFolderName, *syncKey, *folderType, *operation;
NSString *key, *cKey, *nkey, *name, *serverId, *parentId, *nameInCache, *personalFolderName, *syncKey, *folderType, *operation, *parent;
NSMutableDictionary *cachedGUIDs, *metadata;
NSMutableArray *folders, *processedFolders, *allFoldersMetadata;
NSDictionary *folderMetadata, *imapGUIDs;
@@ -1199,9 +1199,19 @@ void handle_eas_terminate(int signum)
{
if ([[folders objectAtIndex:fi] isKindOfClass: [SOGoAppointmentFolder class]])
{
type = ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName] ? 8 : 13);
if ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName])
{
type = 8;
parent = @"0";
}
else
{
type = 13;
parent = [NSString stringWithFormat: @"vevent/%@",personalFolderName];
}
[commands appendFormat: @"<%@><ServerId>%@</ServerId><ParentId>%@</ParentId><DisplayName>%@</DisplayName><Type>%d</Type></%@>", operation,
[name stringByEscapingURL], @"0", [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
[name stringByEscapingURL], [parent stringByEscapingURL], [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
command_count++;
@@ -1209,7 +1219,17 @@ void handle_eas_terminate(int signum)
[o save];
name = [NSString stringWithFormat: @"vtodo/%@", [[folders objectAtIndex:fi] nameInContainer]];
type = ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName] ? 7 : 15);
if ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName])
{
type = 7;
parent = @"0";
}
else
{
type = 15;
parent = [NSString stringWithFormat: @"vtodo/%@",personalFolderName];
}
// We always sync the "Default Tasks folder" (7). For "User-created Tasks folder" (15), we check if we include it in
// the sync process by checking if "Show tasks" is enabled. If not, we skip the folder entirely.
@@ -1217,7 +1237,7 @@ void handle_eas_terminate(int signum)
(type == 15 && [[folders objectAtIndex: fi] showCalendarTasks]))
{
[commands appendFormat: @"<%@><ServerId>%@</ServerId><ParentId>%@</ParentId><DisplayName>%@</DisplayName><Type>%d</Type></%@>", operation,
[name stringByEscapingURL], @"0", [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
[name stringByEscapingURL], [parent stringByEscapingURL], [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
command_count++;
@@ -1252,9 +1272,19 @@ void handle_eas_terminate(int signum)
}
else if ([[folders objectAtIndex:fi] isKindOfClass: [SOGoContactGCSFolder class]])
{
type = ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName] ? 9 : 14);
if ([[[folders objectAtIndex:fi] nameInContainer] isEqualToString: personalFolderName])
{
type = 9;
parent = @"0";
}
else
{
type = 14;
parent = [NSString stringWithFormat: @"vcard/%@",personalFolderName];
}
[commands appendFormat: @"<%@><ServerId>%@</ServerId><ParentId>%@</ParentId><DisplayName>%@</DisplayName><Type>%d</Type></%@>", operation,
[name stringByEscapingURL], @"0", [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
[name stringByEscapingURL], [parent stringByEscapingURL], [[[folders objectAtIndex:fi] displayName] activeSyncRepresentationInContext: context], type, operation];
command_count++;

6
NEWS
View File

@@ -1,3 +1,9 @@
4.0.9 (2019-XX-XX)
------------------
Bug fixes
- [eas] improve FolderSync operation (#4672)
4.0.5 (2018-MM-DD)
------------------