contact and call history improvements

This commit is contained in:
Juha Heinanen
2018-11-19 05:27:24 +02:00
parent fcbc7fe2eb
commit 2a1cb59568
7 changed files with 104 additions and 52 deletions
@@ -94,6 +94,16 @@ object Utils {
return uri.substringAfter(":").substringBefore("@")
}
fun friendlyUri(uri: String, domain: String): String {
val user = uriUserPart(uri)
val host = uriHostPart(uri)
if (host == domain) return user else return "$user@$host"
}
fun aorDomain(aor: String): String {
return aor.substringAfter("@")
}
fun checkUserID(id: String): Boolean {
return Regex("^[a-zA-Z]([._-]|[a-zA-Z0-9]){1,49}\$").matches(id)
}