From 17d30c095911272ce9e8e25c71aee405f79b4b64 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 28 Aug 2021 12:03:50 +0000 Subject: Accept and reject contact requests in the compose pane --- qml/ComposePane.qml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'qml/ComposePane.qml') diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index 1e454e0..5cd0603 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -9,6 +9,10 @@ Pane { required property DcContext context required property var chatId + required property var chat + + property bool canSend: root.chat && root.chat.canSend + property bool isContactRequest: root.chat && root.chat.isContactRequest function createMessage() { @@ -26,6 +30,7 @@ Pane { TextArea { id: messageField + visible: root.canSend Layout.fillWidth: true placeholderText: qsTr("Message") @@ -49,6 +54,7 @@ Pane { Button { id: sendButton + visible: root.canSend Layout.alignment: Qt.AlignBottom @@ -63,5 +69,25 @@ Pane { root.context.setDraft(chatId, null) } } + + Button { + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + + text: "Accept" + onClicked: root.context.acceptChat(root.chatId) + visible: root.isContactRequest + icon.name: "call-start" + } + + Button { + Layout.alignment: Qt.AlignBottom + Layout.fillWidth: true + + text: "Block" + onClicked: root.context.acceptChat(root.chatId) + visible: root.isContactRequest + icon.name: "call-stop" + } } } -- cgit v1.2.3-70-g09d2