mirror of https://github.com/M66B/FairEmail.git
OAuth: ask tenant
This commit is contained in:
parent
632a82a870
commit
83731d082e
|
@ -1291,5 +1291,10 @@ public class EmailProvider implements Parcelable {
|
||||||
String privacy;
|
String privacy;
|
||||||
String prompt;
|
String prompt;
|
||||||
Map<String, String> parameters;
|
Map<String, String> parameters;
|
||||||
|
|
||||||
|
boolean askTenant() {
|
||||||
|
return (authorizationEndpoint.contains("{tenant}") ||
|
||||||
|
tokenEndpoint.contains("{tenant}"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||||
private String name;
|
private String name;
|
||||||
private String privacy;
|
private String privacy;
|
||||||
private boolean askAccount;
|
private boolean askAccount;
|
||||||
|
private boolean askTenant;
|
||||||
|
|
||||||
private String personal;
|
private String personal;
|
||||||
private String address;
|
private String address;
|
||||||
|
@ -137,6 +138,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||||
name = args.getString("name");
|
name = args.getString("name");
|
||||||
privacy = args.getString("privacy");
|
privacy = args.getString("privacy");
|
||||||
askAccount = args.getBoolean("askAccount", false);
|
askAccount = args.getBoolean("askAccount", false);
|
||||||
|
askTenant = args.getBoolean("askTenant", false);
|
||||||
|
|
||||||
personal = args.getString("personal");
|
personal = args.getString("personal");
|
||||||
address = args.getString("address");
|
address = args.getString("address");
|
||||||
|
@ -214,7 +216,7 @@ public class FragmentOAuth extends FragmentBase {
|
||||||
tvTitle.setText(getString(R.string.title_setup_oauth_rationale, name));
|
tvTitle.setText(getString(R.string.title_setup_oauth_rationale, name));
|
||||||
etName.setVisibility(askAccount ? View.VISIBLE : View.GONE);
|
etName.setVisibility(askAccount ? View.VISIBLE : View.GONE);
|
||||||
etEmail.setVisibility(askAccount ? View.VISIBLE : View.GONE);
|
etEmail.setVisibility(askAccount ? View.VISIBLE : View.GONE);
|
||||||
grpTenant.setVisibility(isOutlook(id) ? View.VISIBLE : View.GONE);
|
grpTenant.setVisibility(askTenant ? View.VISIBLE : View.GONE);
|
||||||
pbOAuth.setVisibility(View.GONE);
|
pbOAuth.setVisibility(View.GONE);
|
||||||
tvConfiguring.setVisibility(View.GONE);
|
tvConfiguring.setVisibility(View.GONE);
|
||||||
tvGmailHint.setVisibility("gmail".equals(id) ? View.VISIBLE : View.GONE);
|
tvGmailHint.setVisibility("gmail".equals(id) ? View.VISIBLE : View.GONE);
|
||||||
|
|
|
@ -266,7 +266,8 @@ public class FragmentSetup extends FragmentBase {
|
||||||
.putExtra("id", provider.id)
|
.putExtra("id", provider.id)
|
||||||
.putExtra("name", provider.description)
|
.putExtra("name", provider.description)
|
||||||
.putExtra("privacy", provider.oauth.privacy)
|
.putExtra("privacy", provider.oauth.privacy)
|
||||||
.putExtra("askAccount", provider.oauth.askAccount));
|
.putExtra("askAccount", provider.oauth.askAccount)
|
||||||
|
.putExtra("askTenant", provider.oauth.askTenant()));
|
||||||
resid = res.getIdentifier("provider_" + provider.id, "drawable", pkg);
|
resid = res.getIdentifier("provider_" + provider.id, "drawable", pkg);
|
||||||
if (resid != 0)
|
if (resid != 0)
|
||||||
item.setIcon(resid);
|
item.setIcon(resid);
|
||||||
|
|
Loading…
Reference in New Issue