Small behavior improvement

This commit is contained in:
M66B
2020-01-29 10:06:45 +01:00
parent d8384dfbba
commit 4dfbda4393
2 changed files with 22 additions and 55 deletions

View File

@@ -848,23 +848,14 @@ public class FragmentAccount extends FragmentBase {
host = h.getHost();
}
if (TextUtils.isEmpty(host))
if (should)
return true;
else
throw new IllegalArgumentException(context.getString(R.string.title_no_host));
if (TextUtils.isEmpty(host) && !should)
throw new IllegalArgumentException(context.getString(R.string.title_no_host));
if (TextUtils.isEmpty(port))
port = (starttls ? "143" : "993");
if (TextUtils.isEmpty(user))
if (should)
return true;
else
throw new IllegalArgumentException(context.getString(R.string.title_no_user));
if (synchronize && TextUtils.isEmpty(password) && !insecure)
if (should)
return true;
else
throw new IllegalArgumentException(context.getString(R.string.title_no_password));
if (TextUtils.isEmpty(user) && !should)
throw new IllegalArgumentException(context.getString(R.string.title_no_user));
if (synchronize && TextUtils.isEmpty(password) && !insecure && !should)
throw new IllegalArgumentException(context.getString(R.string.title_no_password));
if (TextUtils.isEmpty(interval))
interval = Integer.toString(EntityAccount.DEFAULT_KEEP_ALIVE_INTERVAL);