Show alert if contact does not have suitable URI

Show alert if calling or messaging is tried on mobile account when device is in airplane mode
This commit is contained in:
Juha Heinanen
2026-05-19 09:16:56 +03:00
parent 5ebfccfe8c
commit caa1baf0c8
10 changed files with 103 additions and 40 deletions
@@ -106,8 +106,11 @@ sealed class Contact {
}
is AndroidContact -> {
if (c.name == name) {
for (u in c.uris)
for (u in c.uris) {
if (tel && !u.startsWith("tel:"))
continue
uris.add(u)
}
return uris
}
}
@@ -207,7 +210,7 @@ sealed class Contact {
cur?.close()
val newList = mutableListOf<AndroidContact>()
for ((_, value) in contacts)
if (value.name != "" && value.uris.isNotEmpty())
if (value.name != "" && (value.uris.isNotEmpty() || value.email != ""))
newList.add(value)
BaresipService.androidContacts.value = newList.toList()
}