Use username for account name

This commit is contained in:
M66B
2020-07-14 08:29:52 +02:00
parent 82c9d82396
commit 88433c9c38
3 changed files with 12 additions and 3 deletions

View File

@@ -446,10 +446,16 @@ public class FragmentOAuth extends FragmentBase {
if (TextUtils.isEmpty(primaryEmail) || identities.size() == 0)
throw new IllegalArgumentException("Primary email address not found");
if (!Helper.EMAIL_ADDRESS.matcher(primaryEmail).matches())
throw new IllegalArgumentException(context.getString(R.string.title_email_invalid, primaryEmail));
Log.i("OAuth email=" + primaryEmail);
for (Pair<String, String> identity : identities)
Log.i("OAuth identity=" + identity.first + "/" + identity.second);
int at = primaryEmail.indexOf('@');
String username = primaryEmail.substring(0, at);
List<EntityFolder> folders;
Log.i("OAuth checking IMAP provider=" + provider.id);
@@ -499,7 +505,7 @@ public class FragmentOAuth extends FragmentBase {
account.user = primaryEmail;
account.password = state;
account.name = provider.name;
account.name = provider.name + "/" + username;
account.synchronize = true;
account.primary = (primary == null);