(feat) now possible to choose which folders to sync over EAS
This commit is contained in:
parent
114622fee0
commit
2ee09159a2
|
@ -707,22 +707,21 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
- (void) processFolderSync: (id <DOMElement>) theDocumentElement
|
- (void) processFolderSync: (id <DOMElement>) theDocumentElement
|
||||||
inResponse: (WOResponse *) theResponse
|
inResponse: (WOResponse *) theResponse
|
||||||
{
|
{
|
||||||
NSString *key, *cKey, *nkey, *name, *serverId, *parentId, *nameInCache, *personalFolderName, *syncKey, *folderType;
|
NSString *key, *cKey, *nkey, *name, *serverId, *parentId, *nameInCache, *personalFolderName, *syncKey, *folderType, *operation;
|
||||||
|
NSMutableDictionary *cachedGUIDs, *metadata;
|
||||||
|
NSMutableArray *folders, *processedFolders;
|
||||||
NSDictionary *folderMetadata, *imapGUIDs;
|
NSDictionary *folderMetadata, *imapGUIDs;
|
||||||
NSArray *allFoldersMetadata, *allKeys;
|
NSArray *allFoldersMetadata, *allKeys;
|
||||||
NSMutableDictionary *cachedGUIDs, *metadata;
|
|
||||||
SOGoMailAccounts *accountsFolder;
|
SOGoMailAccounts *accountsFolder;
|
||||||
SOGoMailAccount *accountFolder;
|
SOGoMailAccount *accountFolder;
|
||||||
NSMutableString *s, *commands;
|
NSMutableString *s, *commands;
|
||||||
SOGoUserFolder *userFolder;
|
SOGoUserFolder *userFolder;
|
||||||
NSMutableArray *folders, *processedFolders;
|
|
||||||
SoSecurityManager *sm;
|
SoSecurityManager *sm;
|
||||||
SOGoCacheGCSObject *o;
|
SOGoCacheGCSObject *o;
|
||||||
id currentFolder;
|
id currentFolder;
|
||||||
NSData *d;
|
NSData *d;
|
||||||
|
|
||||||
int status, command_count, i, type, fi, count;
|
int status, command_count, i, type, fi, count;
|
||||||
|
|
||||||
BOOL first_sync;
|
BOOL first_sync;
|
||||||
|
|
||||||
sm = [SoSecurityManager sharedSecurityManager];
|
sm = [SoSecurityManager sharedSecurityManager];
|
||||||
|
@ -850,8 +849,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
currentFolder = [[[[context activeUser] homeFolderInContext: context] lookupName: folderType inContext: context acquire: NO]
|
currentFolder = [[[[context activeUser] homeFolderInContext: context] lookupName: folderType inContext: context acquire: NO]
|
||||||
lookupName: [cKey substringFromIndex: [cKey rangeOfString: @"/"].location+1] inContext: context acquire: NO];
|
lookupName: [cKey substringFromIndex: [cKey rangeOfString: @"/"].location+1] inContext: context acquire: NO];
|
||||||
|
|
||||||
// remove the folder from device if it doesn't exists or it has not the proper permissions
|
// Remove the folder from device if it doesn't exist, we don't want to sync it, or it doesn't have the proper permissions
|
||||||
if (!currentFolder ||
|
if (!currentFolder ||
|
||||||
|
![currentFolder synchronize] ||
|
||||||
[sm validatePermission: SoPerm_DeleteObjects
|
[sm validatePermission: SoPerm_DeleteObjects
|
||||||
onObject: currentFolder
|
onObject: currentFolder
|
||||||
inContext: context] ||
|
inContext: context] ||
|
||||||
|
@ -965,11 +965,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
folders = [[[[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO] subFolders] mutableCopy];
|
folders = [[[[[context activeUser] homeFolderInContext: context] lookupName: @"Calendar" inContext: context acquire: NO] subFolders] mutableCopy];
|
||||||
[folders addObjectsFromArray: [[[[context activeUser] homeFolderInContext: context] lookupName: @"Contacts" inContext: context acquire: NO] subFolders]];
|
[folders addObjectsFromArray: [[[[context activeUser] homeFolderInContext: context] lookupName: @"Contacts" inContext: context acquire: NO] subFolders]];
|
||||||
|
|
||||||
// Inside this loop we remove all the folder without write/delete permissions
|
// We remove all the folders that aren't GCS-ones, that we don't want to synchronize and
|
||||||
|
// the ones without write/delete permissions
|
||||||
count = [folders count]-1;
|
count = [folders count]-1;
|
||||||
for (; count >= 0; count--)
|
for (; count >= 0; count--)
|
||||||
{
|
{
|
||||||
if ([sm validatePermission: SoPerm_DeleteObjects
|
if (![[folders objectAtIndex: count] isKindOfClass: [SOGoGCSFolder class]] ||
|
||||||
|
![[folders objectAtIndex: count] synchronize] ||
|
||||||
|
[sm validatePermission: SoPerm_DeleteObjects
|
||||||
onObject: [folders objectAtIndex: count]
|
onObject: [folders objectAtIndex: count]
|
||||||
inContext: context] ||
|
inContext: context] ||
|
||||||
[sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
|
[sm validatePermission: SoPerm_AddDocumentsImagesAndFiles
|
||||||
|
@ -981,7 +984,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
}
|
}
|
||||||
|
|
||||||
count = [folders count]-1;
|
count = [folders count]-1;
|
||||||
NSString *operation;
|
|
||||||
|
|
||||||
for (fi = 0; fi <= count ; fi++)
|
for (fi = 0; fi <= count ; fi++)
|
||||||
{
|
{
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
New features
|
New features
|
||||||
- initial S/MIME support for EAS (#3327)
|
- initial S/MIME support for EAS (#3327)
|
||||||
|
- now possible to choose which folders to sync over EAS
|
||||||
|
|
||||||
Enhancements
|
Enhancements
|
||||||
- we no longer always entirely rewrite messages for Outlook 2013 when using EAS
|
- we no longer always entirely rewrite messages for Outlook 2013 when using EAS
|
||||||
|
|
Loading…
Reference in a new issue