diff options
Diffstat (limited to 'qml')
-rw-r--r-- | qml/ChatPage.qml | 16 | ||||
-rw-r--r-- | qml/ChatlistPage.qml | 12 | ||||
-rw-r--r-- | qml/Message.qml | 4 |
3 files changed, 17 insertions, 15 deletions
diff --git a/qml/ChatPage.qml b/qml/ChatPage.qml index 3099488..9b2e7c6 100644 --- a/qml/ChatPage.qml +++ b/qml/ChatPage.qml @@ -15,7 +15,20 @@ Kirigami.ScrollablePage { required property DcAccountsEventEmitter eventEmitter required property var chatId - readonly property DcChat chat: context.getChat(chatId) + property DcChat chat: context.getChat(chatId) + + contextualActions: [ + Kirigami.Action { + text: "Accept contact request" + onTriggered: chatPage.context.unblockChat(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. @@ -57,6 +70,7 @@ Kirigami.ScrollablePage { function onChatModified() { console.log("CHAT MODIFIED!") + chatPage.chat = context.getChat(chatId) } function onIncomingMessage(accountId, chatId, msgId) { console.log("Incoming message for chat " + chatId) diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index 343b8da..7ba516a 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -49,14 +49,6 @@ Kirigami.ScrollablePage { console.log("Can't open Settings page") } } - }, - Kirigami.Action { - text: "Contact requests" - onTriggered: { - chatlist.currentIndex = -1 - loadChat(1) - console.log("Opening contact requests chat"); - } } ] @@ -145,8 +137,8 @@ Kirigami.ScrollablePage { var chatId = chatlistModel.get(chatlist.currentIndex).chatId - if (chatId == 1 || chatId > 9) { - // chatId == DC_CHAT_ID_DEADDROP || chatId > DC_CHAT_ID_LAST_SPECIAL + if (chatId > 9) { + // chatId > DC_CHAT_ID_LAST_SPECIAL loadChat(chatId) } else if (chatId == 6) { diff --git a/qml/Message.qml b/qml/Message.qml index 1c7f7f3..69f5f62 100644 --- a/qml/Message.qml +++ b/qml/Message.qml @@ -148,10 +148,6 @@ RowLayout { text: "Info" onTriggered: messageDialog.open() } - Action { - text: "Start chat" - onTriggered: messageObject.context.decideOnContactRequest(messageObject.message.id, 0) - } } } |