mirror of https://github.com/M66B/FairEmail.git
Added guessing of mailto/tel schemes
This commit is contained in:
parent
456a998a04
commit
c18e761486
|
@ -141,7 +141,14 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||||
|
|
||||||
final Uri uri;
|
final Uri uri;
|
||||||
if (_uri.getScheme() == null) {
|
if (_uri.getScheme() == null) {
|
||||||
Uri g = Uri.parse(URLUtil.guessUrl(_uri.toString()));
|
String url = _uri.toString();
|
||||||
|
if (Helper.EMAIL_ADDRESS.matcher(url).matches())
|
||||||
|
uri = Uri.parse("mailto:" + _uri.toString());
|
||||||
|
else if (android.util.Patterns.PHONE.matcher(url).matches())
|
||||||
|
// Alternative: PhoneNumberUtils.isGlobalPhoneNumber()
|
||||||
|
uri = Uri.parse("tel:" + _uri.toString());
|
||||||
|
else {
|
||||||
|
Uri g = Uri.parse(URLUtil.guessUrl(url));
|
||||||
String scheme = g.getScheme();
|
String scheme = g.getScheme();
|
||||||
if (scheme != null) {
|
if (scheme != null) {
|
||||||
if ("http".equals(scheme))
|
if ("http".equals(scheme))
|
||||||
|
@ -149,6 +156,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||||
uri = Uri.parse(scheme + "://" + _uri.toString());
|
uri = Uri.parse(scheme + "://" + _uri.toString());
|
||||||
} else
|
} else
|
||||||
uri = _uri;
|
uri = _uri;
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
uri = _uri;
|
uri = _uri;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue