TF-3976 Support DNS SRV resolvers without Cloudflare/Google dependency

This commit is contained in:
dab246
2025-10-28 11:29:37 +07:00
committed by Dat H. Pham
parent 17b48d947b
commit 37deead391
9 changed files with 393 additions and 96 deletions
@@ -1,23 +1,23 @@
import 'package:tmail_ui_user/features/login/data/datasource/login_datasource.dart';
import 'package:tmail_ui_user/features/login/data/network/dns_service.dart';
import 'package:tmail_ui_user/features/login/data/network/dns_lookup/dns_lookup_manager.dart';
import 'package:tmail_ui_user/features/login/domain/model/recent_login_url.dart';
import 'package:tmail_ui_user/features/login/domain/model/recent_login_username.dart';
import 'package:tmail_ui_user/main/exceptions/exception_thrower.dart';
class LoginDataSourceImpl implements LoginDataSource {
final DNSService _dnsService;
final DnsLookupManager _dnsLookupManager;
final ExceptionThrower _exceptionThrower;
LoginDataSourceImpl(
this._dnsService,
this._dnsLookupManager,
this._exceptionThrower
);
@override
Future<String> dnsLookupToGetJmapUrl(String emailAddress) {
return Future.sync(() async {
return await _dnsService.getJmapUrl(emailAddress);
return await _dnsLookupManager.lookupJmapUrl(emailAddress);
}).catchError(_exceptionThrower.throwException);
}