diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml index 4dc084f20..2cf002549 100644 --- a/imports/Spectral/Panel/RoomListPanel.qml +++ b/imports/Spectral/Panel/RoomListPanel.qml @@ -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