X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/f02bfbdd6749fc154de0d92fc49a16b1fa57ccea..e901b609baa4dd5f681e2a5257c9e504997e3377:/src/com/owncloud/android/authentication/AccountUtils.java?ds=sidebyside diff --git a/src/com/owncloud/android/authentication/AccountUtils.java b/src/com/owncloud/android/authentication/AccountUtils.java index 5f0441c5..dc023444 100644 --- a/src/com/owncloud/android/authentication/AccountUtils.java +++ b/src/com/owncloud/android/authentication/AccountUtils.java @@ -18,9 +18,11 @@ package com.owncloud.android.authentication; +import java.util.Locale; + import com.owncloud.android.MainApp; -import com.owncloud.android.lib.accounts.AccountTypeUtils; -import com.owncloud.android.lib.utils.OwnCloudVersion; +import com.owncloud.android.lib.common.accounts.AccountTypeUtils; +import com.owncloud.android.lib.resources.status.OwnCloudVersion; import android.accounts.Account; import android.accounts.AccountManager; @@ -81,8 +83,18 @@ public class AccountUtils { MainApp.getAccountType()); if (account != null && account.name != null) { - for (Account ac : ocAccounts) { - if (ac.name.equals(account.name)) { + int lastAtPos = account.name.lastIndexOf("@"); + String hostAndPort = account.name.substring(lastAtPos + 1); + String username = account.name.substring(0, lastAtPos); + String otherHostAndPort, otherUsername; + Locale currentLocale = context.getResources().getConfiguration().locale; + for (Account otherAccount : ocAccounts) { + lastAtPos = otherAccount.name.lastIndexOf("@"); + otherHostAndPort = otherAccount.name.substring(lastAtPos + 1); + otherUsername = otherAccount.name.substring(0, lastAtPos); + if (otherHostAndPort.equals(hostAndPort) && + otherUsername.toLowerCase(currentLocale). + equals(username.toLowerCase(currentLocale))) { return true; } }