Skip to content

Commit

Permalink
Correctly get the collection/key IDs (fixes #3775)
Browse files Browse the repository at this point in the history
  • Loading branch information
extrafu committed Jul 25, 2016
1 parent c827b62 commit 8545f89
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ActiveSync/SOGoActiveSyncDispatcher+Sync.m
Expand Up @@ -119,7 +119,7 @@ - (void) _setOrUnsetSyncRequest: (BOOL) set
{
SOGoCacheGCSObject *o;
NSNumber *processIdentifier;
NSString *key;
NSString *key, *collectionId;;
int i;

processIdentifier = [NSNumber numberWithInt: [[NSProcessInfo processInfo] processIdentifier]];
Expand All @@ -139,7 +139,13 @@ - (void) _setOrUnsetSyncRequest: (BOOL) set

for (i = 0; i < [collections count]; i++)
{
key = [NSString stringWithFormat: @"SyncRequest+%@", [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL]];
if ([[collections objectAtIndex: i] isKindOfClass: [NSString class]])
collectionId = [collections objectAtIndex: i];
else
collectionId = [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL];

key = [NSString stringWithFormat: @"SyncRequest+%@", collectionId];

[[o properties] setObject: processIdentifier forKey: key];
}
}
Expand All @@ -148,7 +154,13 @@ - (void) _setOrUnsetSyncRequest: (BOOL) set
[[o properties] removeObjectForKey: @"SyncRequest"];
for (i = 0; i < [collections count]; i++)
{
key = [NSString stringWithFormat: @"SyncRequest+%@", [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL]];
if ([[collections objectAtIndex: i] isKindOfClass: [NSString class]])
collectionId = [collections objectAtIndex: i];
else
collectionId = [[[(id)[[collections objectAtIndex: i] getElementsByTagName: @"CollectionId"] lastObject] textValue] stringByUnescapingURL];

key = [NSString stringWithFormat: @"SyncRequest+%@", collectionId];

[[o properties] removeObjectForKey: key];
}
}
Expand Down

0 comments on commit 8545f89

Please sign in to comment.