Show an error message for invalid server url
[pub/Android/ownCloud.git] / src / com / owncloud / android / authentication / AuthenticatorActivity.java
index d88d778..d43df3f 100644 (file)
@@ -1,6 +1,11 @@
-/* ownCloud Android client application\r
+/**\r
+ *   ownCloud Android client application\r
+ *\r
+ *   @author Bartek Przybylski\r
+ *   @author David A. Velasco\r
+ *   @author masensio\r
  *   Copyright (C) 2012  Bartek Przybylski\r
  *   Copyright (C) 2012  Bartek Przybylski\r
- *   Copyright (C) 2012-2015 ownCloud Inc.\r
+ *   Copyright (C) 2015 ownCloud Inc.\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License version 2,\r
  *\r
  *   This program is free software: you can redistribute it and/or modify\r
  *   it under the terms of the GNU General Public License version 2,\r
@@ -91,10 +96,6 @@ import com.owncloud.android.utils.DisplayUtils;
 \r
 /**\r
  * This Activity is used to add an ownCloud account to the App\r
 \r
 /**\r
  * This Activity is used to add an ownCloud account to the App\r
- * \r
- * @author Bartek Przybylski\r
- * @author David A. Velasco\r
- * @author masensio\r
  */\r
 public class AuthenticatorActivity extends AccountAuthenticatorActivity\r
         implements  OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener,\r
  */\r
 public class AuthenticatorActivity extends AccountAuthenticatorActivity\r
         implements  OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener,\r
@@ -379,7 +380,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
             findViewById(R.id.hostUrlFrame).setVisibility(View.GONE);\r
             mRefreshButton = findViewById(R.id.centeredRefreshButton);\r
         }\r
             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
                 mWaitingForOpId > Integer.MAX_VALUE);\r
         mServerStatusView = (TextView) findViewById(R.id.server_status_text);\r
         showServerStatus();\r
@@ -772,10 +773,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
         mOkButton.setEnabled(false);\r
         mServerInfo = new GetServerInfoOperation.ServerInfo();\r
         showRefreshButton(false);\r
         mOkButton.setEnabled(false);\r
         mServerInfo = new GetServerInfoOperation.ServerInfo();\r
         showRefreshButton(false);\r
-        \r
+\r
         if (uri.length() != 0) {\r
             // Handle internationalized domain names\r
         if (uri.length() != 0) {\r
             // Handle internationalized domain names\r
-            uri = DisplayUtils.convertIdn(uri, true);\r
+            if (!uri.startsWith(".")) {\r
+                uri = DisplayUtils.convertIdn(uri, true);\r
+            }\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r
             mServerStatusText = R.string.auth_testing_connection;\r
             mServerStatusIcon = R.drawable.progress_small;\r
             showServerStatus();\r