Join room from search bar.
This commit is contained in:
parent
dd0b59959f
commit
0f21582752
|
@ -627,6 +627,8 @@ Item {
|
|||
|
||||
AutoTextField {
|
||||
readonly property bool active: text
|
||||
readonly property bool isRoom: text.match(/#.*:.*\..*/g) || text.match(/!.*:.*\..*/g)
|
||||
readonly property bool isUser: text.match(/@.*:.*\..*/g)
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
@ -641,6 +643,26 @@ Item {
|
|||
background: Item {}
|
||||
}
|
||||
|
||||
ItemDelegate {
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
|
||||
visible: searchField.isRoom || searchField.isUser
|
||||
|
||||
contentItem: MaterialIcon { icon: "\ue145" }
|
||||
|
||||
onClicked: {
|
||||
if (searchField.isRoom) {
|
||||
controller.joinRoom(controller.connection, searchField.text)
|
||||
return
|
||||
}
|
||||
if (searchField.isUser) {
|
||||
controller.createDirectChat(controller.connection, searchField.text)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Avatar {
|
||||
Layout.preferredWidth: height
|
||||
Layout.fillHeight: true
|
||||
|
|
Loading…
Reference in New Issue