mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-03 07:36:31 +02:00
Find provider by host
This commit is contained in:
@@ -333,6 +333,17 @@ public class EmailProvider implements Parcelable {
|
||||
throw new FileNotFoundException("provider id=" + id);
|
||||
}
|
||||
|
||||
static EmailProvider getProviderByHost(Context context, @NonNull String host) {
|
||||
for (EmailProvider provider : loadProfiles(context)) {
|
||||
if (provider.imap != null && host.equals(provider.imap.host))
|
||||
return provider;
|
||||
if (provider.smtp != null && host.equals(provider.smtp.host))
|
||||
return provider;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<EmailProvider> getProviders(Context context) {
|
||||
List<EmailProvider> result = new ArrayList<>();
|
||||
for (EmailProvider provider : loadProfiles(context))
|
||||
|
||||
Reference in New Issue
Block a user