Filter only '/' character in user input when version of server is 8.1 or later
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index 1e4e8b4..713851b 100644 (file)
@@ -380,7 +380,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);\r
             mRefreshButton = findViewById(R.id.centeredRefreshButton);\r
         }\r
-        showRefreshButton(mServerIsChecked && !mServerIsValid && \r
+        showRefreshButton(mServerIsChecked && !mServerIsValid &&\r
                 mWaitingForOpId > Integer.MAX_VALUE);\r
         mServerStatusView = (TextView) findViewById(R.id.server_status_text);\r
         showServerStatus();\r
@@ -773,10 +773,11 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         mOkButton.setEnabled(false);\r
         mServerInfo = new GetServerInfoOperation.ServerInfo();\r
         showRefreshButton(false);\r
-        \r
+\r
         if (uri.length() != 0) {\r
             // Handle internationalized domain names\r
             uri = DisplayUtils.convertIdn(uri, true);\r
+\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
@@ -1119,13 +1120,9 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
 \r
     // TODO remove, if possible\r
     private String trimUrlWebdav(String url){       \r
-        if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0)){\r
-            url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0.length());             \r
-        } else if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_2_0)){\r
-            url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_2_0.length());             \r
-        } else if (url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_1_2)){\r
-            url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_1_2.length());             \r
-        } \r
+        if(url.toLowerCase().endsWith(AccountUtils.WEBDAV_PATH_4_0_AND_LATER)){\r
+            url = url.substring(0, url.length() - AccountUtils.WEBDAV_PATH_4_0_AND_LATER.length());\r
+        }\r
         return (url != null ? url : "");\r
     }\r
 \r
@@ -1487,6 +1484,13 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
                 );\r
             }\r
 \r
+            // include account version with the new account\r
+            mAccountMgr.setUserData(\r
+                mAccount,\r
+                Constants.KEY_OC_ACCOUNT_VERSION,\r
+                Integer.toString(AccountUtils.ACCOUNT_VERSION)\r
+            );\r
+\r
             /// add the new account as default in preferences, if there is none already\r
             Account defaultAccount = AccountUtils.getCurrentOwnCloudAccount(this);\r
             if (defaultAccount == null) {\r