aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-08-28 12:03:50 +0000
committerlink2xt <link2xt@testrun.org>2021-08-28 15:06:22 +0300
commit17d30c095911272ce9e8e25c71aee405f79b4b64 (patch)
treec740d62cb38e56b986a68c2ed69191b305cda20a
parente3b1f014df55f08f557667919d271f079f5f492f (diff)
downloadkdeltachat-17d30c095911272ce9e8e25c71aee405f79b4b64.tar.gz
kdeltachat-17d30c095911272ce9e8e25c71aee405f79b4b64.zip
Accept and reject contact requests in the compose pane
-rw-r--r--qml/ChatPage.qml15
-rw-r--r--qml/ComposePane.qml26
2 files changed, 27 insertions, 14 deletions
diff --git a/qml/ChatPage.qml b/qml/ChatPage.qml
index 944231d..a0541cc 100644
--- a/qml/ChatPage.qml
+++ b/qml/ChatPage.qml
@@ -17,19 +17,6 @@ Kirigami.ScrollablePage {
required property var chatId
property DcChat chat: context.getChat(chatId)
- contextualActions: [
- Kirigami.Action {
- text: "Accept contact request"
- onTriggered: chatPage.context.acceptChat(chatPage.chatId)
- visible: chatPage.chat && chatPage.chat.isContactRequest
- },
- Kirigami.Action {
- text: "Block contact request"
- onTriggered: chatPage.context.blockChat(chatPage.chatId)
- visible: chatPage.chat && chatPage.chat.isContactRequest
- }
- ]
-
function updateMessagelist() {
// Reverse message list, because it is laid out from bottom to top.
let messagelist = context.getMsgIdList(chatId).reverse()
@@ -126,8 +113,8 @@ Kirigami.ScrollablePage {
footer: ComposePane {
context: chatPage.context
chatId: chatPage.chatId
+ chat: chatPage.chat
Layout.fillWidth: true
- visible: chatPage.chat && chatPage.chat.canSend
}
}
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"
+ }
}
}