|
@@ -790,11 +790,14 @@ public abstract class FileActivity extends DrawerActivity
|
|
|
String link = "";
|
|
|
OCFile file = null;
|
|
|
for (Object object : result.getData()) {
|
|
|
- OCShare shareLink = (OCShare) object;
|
|
|
- if (TAG_PUBLIC_LINK.equalsIgnoreCase(shareLink.getShareType().name())) {
|
|
|
- link = shareLink.getShareLink();
|
|
|
- file = getStorageManager().getFileByPath(shareLink.getPath());
|
|
|
- break;
|
|
|
+ if (object instanceof OCShare shareLink) {
|
|
|
+ ShareType shareType = shareLink.getShareType();
|
|
|
+
|
|
|
+ if (shareType != null && TAG_PUBLIC_LINK.equalsIgnoreCase(shareType.name())) {
|
|
|
+ link = shareLink.getShareLink();
|
|
|
+ file = getStorageManager().getFileByEncryptedRemotePath(shareLink.getPath());
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -804,8 +807,12 @@ public abstract class FileActivity extends DrawerActivity
|
|
|
sharingFragment.onUpdateShareInformation(result, file);
|
|
|
}
|
|
|
|
|
|
- if (fileListFragment instanceof OCFileListFragment && file != null) {
|
|
|
- ((OCFileListFragment) fileListFragment).updateOCFile(file);
|
|
|
+ if (fileListFragment instanceof OCFileListFragment ocFileListFragment && file != null) {
|
|
|
+ if (ocFileListFragment.getAdapterFiles().contains(file)) {
|
|
|
+ ocFileListFragment.updateOCFile(file);
|
|
|
+ } else {
|
|
|
+ DisplayUtils.showSnackMessage(this, R.string.file_activity_shared_file_cannot_be_updated);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
// Detect Failure (403) --> maybe needs password
|