onedrive: fix server-side copy completely disabled on OneDrive for Business

This fixes a little problem in PR #4903, which is a fix for #4342
This commit is contained in:
Cnly 2021-01-06 02:57:51 +08:00
parent 5d1f947f32
commit 00bf40a8ef
1 changed files with 7 additions and 1 deletions

View File

@ -1032,7 +1032,13 @@ func (f *Fs) Copy(ctx context.Context, src fs.Object, remote string) (fs.Object,
return nil, fs.ErrorCantCopy
}
if f.driveType != srcObj.fs.driveType {
fs.Debugf(src, "Can't server-side copy - not both drives are OneDrive Personal")
fs.Debugf(src, "Can't server-side copy - drive types differ")
return nil, fs.ErrorCantCopy
}
// For OneDrive Business, this is only supported within the same drive
if f.driveType != driveTypePersonal && srcObj.fs.driveID != f.driveID {
fs.Debugf(src, "Can't server-side copy - cross-drive but not OneDrive Personal")
return nil, fs.ErrorCantCopy
}