Browse Source

Show error message from server when update of permissions fail

David A. Velasco 9 years ago
parent
commit
0d4c9b9961
2 changed files with 5 additions and 3 deletions
  1. 2 2
      res/values/strings.xml
  2. 3 1
      src/com/owncloud/android/utils/ErrorMessageAdapter.java

+ 2 - 2
res/values/strings.xml

@@ -287,7 +287,7 @@
 	<string name="unshare_link_file_no_exist">Unable to unshare. Please check whether the file exists</string>
 	<string name="unshare_link_file_error">An error occurred while trying to unshare this file or folder</string>
     <string name="update_link_file_no_exist">Unable to update. Please check whether the file exists </string>
-    <string name="update_link_file_error">An error occurred while trying to update the shared link</string>
+    <string name="update_link_file_error">An error occurred while trying to update the share</string>
     <string name="share_link_password_title">Enter a password</string>
     <string name="share_link_empty_password">You must enter a password</string>
 
@@ -309,7 +309,7 @@
     <string name="forbidden_permissions_delete">to delete this file</string>
     <string name="share_link_forbidden_permissions">to share this file</string>
     <string name="unshare_link_forbidden_permissions">to unshare this file</string>
-    <string name="update_link_forbidden_permissions">to update this shared link</string>
+    <string name="update_link_forbidden_permissions">to update this share</string>
     <string name="forbidden_permissions_create">to create the file</string>
     <string name="uploader_upload_forbidden_permissions">to upload in this folder</string>
     <string name="downloader_download_file_not_found">The file is no longer available on the server</string>

+ 3 - 1
src/com/owncloud/android/utils/ErrorMessageAdapter.java

@@ -39,6 +39,7 @@ import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UnshareOperation;
+import com.owncloud.android.operations.UpdateSharePermissionsOperation;
 import com.owncloud.android.operations.UpdateShareViaLinkOperation;
 import com.owncloud.android.operations.UploadFileOperation;
 
@@ -204,7 +205,8 @@ public class ErrorMessageAdapter {
                 message = res.getString(R.string.unshare_link_file_error);
             }
 
-        } else if (operation instanceof UpdateShareViaLinkOperation) {
+        } else if (operation instanceof UpdateShareViaLinkOperation ||
+                    operation instanceof UpdateSharePermissionsOperation) {
 
             if (result.getData() != null && result.getData().size() > 0) {
                 message = (String) result.getData().get(0);     // share API sends its own error messages