Commit 1faa1db3 authored by Christophe Deschamps's avatar Christophe Deschamps
Browse files

Ne pas forcer le format sip: ou sips: On part du principe que si l'utilisateur...

Ne pas forcer le format sip: ou sips: On part du principe que si l'utilisateur ne met rien on met sip:


Former-commit-id: cc4182e02e2484009b9378287da02c679eb509a7
parent 58721d26
......@@ -90,7 +90,7 @@ class DeviceEditorViewModel : ViewModelWithTools() {
device = Device(
if (type.value == 0) null else availableDeviceTypes.get(type.value!!).backingKey,
name.first.value!!,
address.first.value!!,
if (address.first.value!!.startsWith("sip:") || address.first.value!!.startsWith("sips:")) address.first.value!! else "sip:${address.first.value}",
if (actionsMethod.value == 0) null else availableMethodTypes.get(actionsMethod.value!!).backingKey,
ArrayList()
)
......@@ -109,7 +109,7 @@ class DeviceEditorViewModel : ViewModelWithTools() {
it.type =
if (type.value == 0) null else availableDeviceTypes.get(type.value!!).backingKey
it.name = name.first.value!!
it.address = address.first.value!!
it.address = if (address.first.value!!.startsWith("sip:") || address.first.value!!.startsWith("sips:")) address.first.value!! else "sip:${address.first.value}"
it.actionsMethodType =
if (actionsMethod.value == 0) null else availableMethodTypes.get(actionsMethod.value!!).backingKey
it.actions = ArrayList()
......
......@@ -8,7 +8,7 @@ class ValidatorFactory {
RegExpFormatValidator("^[a-zA-Z0-9.]*$", "invalid_host_name")
val numberEmptyOrValidValidator = RegExpFormatValidator("^[0-9]*$", "invalid_number")
val sipUri =
NonEmptyWithRegExpFormatValidator("^(sips?):([^@]+)(?:@(.+))?$", "invalid_sip_uri")
NonEmptyWithRegExpFormatValidator("^([^@]+)(?:@(.+))?$", "invalid_sip_uri")
val actionCode = RegExpFormatValidator("^[0-9#*]+$", "invalid_action_code")
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment