String username = mUsernameInput.getText().toString().trim();\r
if (isOAuth) {\r
username = "OAuth_user" + (new java.util.Random(System.currentTimeMillis())).nextLong();\r
- } \r
- String accountName = username + "@" + uri.getHost();\r
- if (uri.getPort() >= 0) {\r
- accountName += ":" + uri.getPort();\r
}\r
+ String accountName = com.owncloud.android.lib.common.accounts.AccountUtils.\r
+ buildAccountName(uri, username);\r
Account newAccount = new Account(accountName, MainApp.getAccountType());\r
if (AccountUtils.exists(newAccount, getApplicationContext())) {\r
// fail - not a new account, but an existing one; disallow\r