mirror of https://github.com/M66B/FairEmail.git
Decode tel URIs
This commit is contained in:
parent
5b2b41c166
commit
8df733e65c
|
@ -550,17 +550,24 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Spanned format(Uri uri, Context context) {
|
private Spanned format(Uri uri, Context context) {
|
||||||
|
String scheme = uri.getScheme();
|
||||||
|
String host = uri.getHost();
|
||||||
String text = uri.toString();
|
String text = uri.toString();
|
||||||
SpannableStringBuilder ssb = new SpannableStringBuilder(text);
|
SpannableStringBuilder ssb = new SpannableStringBuilder(text);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String host = uri.getHost();
|
|
||||||
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
|
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
|
||||||
|
|
||||||
if (host == null && "mailto".equals(uri.getScheme())) {
|
if ("tel".equals(scheme)) {
|
||||||
|
// tel://+123%2045%20678%123456
|
||||||
|
host = Uri.decode(host);
|
||||||
|
text = "tel://" + host;
|
||||||
|
} else if ("mailto".equals(scheme)) {
|
||||||
|
if (host != null) {
|
||||||
MailTo email = MailTo.parse(uri.toString());
|
MailTo email = MailTo.parse(uri.toString());
|
||||||
host = UriHelper.getEmailDomain(email.getTo());
|
host = UriHelper.getEmailDomain(email.getTo());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (host != null) {
|
if (host != null) {
|
||||||
int index = text.indexOf(host);
|
int index = text.indexOf(host);
|
||||||
|
|
Loading…
Reference in New Issue