get rename message from RichDocuments

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-06-04 07:53:34 +02:00 committed by Andy Scherzinger
parent 4221ae50d9
commit bf8e50c1fc
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -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);
}
}
}