Send update of share permissions in reshared remote shares

This commit is contained in:
David A. Velasco 2016-04-19 16:43:34 +02:00 committed by Juan Carlos González Cabrero
parent 9f51a01c82
commit bc353af37e

View file

@ -256,17 +256,26 @@ public class EditShareFragment extends Fragment {
boolean isFederated = ShareType.FEDERATED.equals(mShare.getShareType());
if (mFile.isFolder()) {
if (isChecked) {
if (!isFederated) {
/// not federated shares -> enable all the subpermisions
for (int i = 0; i < sSubordinateCheckBoxIds.length; i++) {
//noinspection ConstantConditions, prevented in the method beginning
subordinate = (CompoundButton) getView().findViewById(sSubordinateCheckBoxIds[i]);
if (!isFederated) {
subordinate.setVisibility(View.VISIBLE);
}
if (!subordinate.isChecked() &&
!mFile.isSharedWithMe()) { // see (1)
toggleDisablingListener(subordinate);
}
}
} else {
/// federated share -> enable delete subpermission, as server side; TODO why?
//noinspection ConstantConditions, prevented in the method beginning
subordinate = (CompoundButton) getView().findViewById(R.id.canEditDeleteCheckBox);
if (!subordinate.isChecked()) {
toggleDisablingListener(subordinate);
}
}
} else {
for (int i = 0; i < sSubordinateCheckBoxIds.length; i++) {
//noinspection ConstantConditions, prevented in the method beginning
@ -279,7 +288,8 @@ public class EditShareFragment extends Fragment {
}
}
if(!(mFile.isFolder() && isChecked && mFile.isSharedWithMe())) { // see (1)
if(!(mFile.isFolder() && isChecked && mFile.isSharedWithMe()) // see (1)
|| isFederated ) {
updatePermissionsToShare();
}