Browse Source

Merge pull request #4114 from nextcloud/richDocumentsRenameMessage

get rename message from RichDocuments
Andy Scherzinger 5 years ago
parent
commit
c003f12c4c

+ 13 - 0
src/main/java/com/owncloud/android/ui/activity/RichDocumentsWebView.java

@@ -405,6 +405,19 @@ public class RichDocumentsWebView extends ExternalSiteWebView {
 
             downloadmanager.enqueue(request);
         }
+
+        @JavascriptInterface
+        public void fileRename(String renameString) {
+            // when shared file is renamed in another instance, we will get notified about it
+            // need to change filename for sharing
+            try {
+                JSONObject renameJson = new JSONObject(renameString);
+                String newName = renameJson.getString("NewName");
+                file.setFileName(newName);
+            } catch (JSONException e) {
+                Log_OC.e(this, "Failed to parse rename json message: " + e);
+            }
+        }
     }