Skip to content

Commit

Permalink
Update sync.d
Browse files Browse the repository at this point in the history
* Add same check to ensure that if this is a Business Account and an online shared folder, 'sync_business_shared_items' needs to be enabled
  • Loading branch information
abraunegg committed Oct 8, 2024
1 parent c9b51ac commit 84b2533
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/sync.d
Original file line number Diff line number Diff line change
Expand Up @@ -773,17 +773,26 @@ class SyncEngine {
// Is this item a potential Shared Folder?
// Is this JSON a remote object
if (isItemRemote(onlinePathData)) {
// The path we are seeking is remote to our account drive id
searchItem.driveId = onlinePathData["remoteItem"]["parentReference"]["driveId"].str;
searchItem.id = onlinePathData["remoteItem"]["id"].str;
// Is this a Personal Account Type or has 'sync_business_shared_items' been enabled?
if ((appConfig.accountType == "personal") || (appConfig.getValueBool("sync_business_shared_items"))) {
// The path we are seeking is remote to our account drive id
searchItem.driveId = onlinePathData["remoteItem"]["parentReference"]["driveId"].str;
searchItem.id = onlinePathData["remoteItem"]["id"].str;
} else {
// This is a shared folder location, but we are not a 'personal' account, and 'sync_business_shared_items' has not been enabled
addLogEntry();
addLogEntry("ERROR: The requested --single-directory path to sync is a Shared Folder online and 'sync_business_shared_items' is not enabled");
addLogEntry();
forceExit();
}
}

// Set these items so that these can be used as required
singleDirectoryScopeDriveId = searchItem.driveId;
singleDirectoryScopeItemId = searchItem.id;
} else {
addLogEntry();
addLogEntry("The requested --single-directory path to sync has generated an error. Please correct this error and try again.");
addLogEntry("ERROR: The requested --single-directory path to sync has generated an error. Please correct this error and try again.");
addLogEntry();
forceExit();
}
Expand Down

0 comments on commit 84b2533

Please sign in to comment.