Unverified Commit 1e791c06 authored by Linus Jahn's avatar Linus Jahn 🔌
Browse files

Always make JIDs lower case

This makes the own account and any added contacts always have a lower case JID
locally to fix issues with two contacts being seperated because of spelling with
and without capital letters.

Also this fixes/improves the condition for the 'Add' button on the
AddContactSheet.
parent 2562a928
......@@ -123,7 +123,7 @@ Kirigami.Page {
onClicked: {
// connect to given account data
kaidan.jid = jidField.text
kaidan.jid = jidField.text.toLowerCase()
kaidan.password = passField.text
kaidan.mainConnect()
}
......
......@@ -100,9 +100,14 @@ Kirigami.OverlaySheet {
Controls.Button {
id: addButton
text: qsTr("Add")
enabled: jidField.length >= 3 && jidField.contains("@")
enabled: {
jidField.length >= 3 && // JID needs to be at least 3 chars longs
jidField.text.includes("@") && // JID has to contain '@'
jidField.text.slice(-1) !== "@" // last character is no '@'
}
onClicked: {
kaidan.addContact(jidField.text, nickField.text, msgField.text)
kaidan.addContact(jidField.text.toLowerCase(),
nickField.text, msgField.text)
clearInput()
close()
}
......
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