diff options
author | link2xt <link2xt@testrun.org> | 2021-06-06 17:29:05 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2021-06-06 17:29:05 +0300 |
commit | fa0dfcb64de83dbe397690422ea584961c145940 (patch) | |
tree | c24c2c4cc9b77b3f41d49643326cf78b123b4e14 | |
parent | 0b7723991eb555f08b1910cbbb7834585dff7fa4 (diff) | |
download | kdeltachat-fa0dfcb64de83dbe397690422ea584961c145940.tar.gz kdeltachat-fa0dfcb64de83dbe397690422ea584961c145940.zip |
Make it possible to get a list of archived chats
-rw-r--r-- | context.cpp | 4 | ||||
-rw-r--r-- | context.h | 2 | ||||
-rw-r--r-- | qml/ChatlistPage.qml | 4 |
3 files changed, 6 insertions, 4 deletions
diff --git a/context.cpp b/context.cpp index f3e698a..ea9c5c4 100644 --- a/context.cpp +++ b/context.cpp @@ -56,9 +56,9 @@ Context::getInfo() } DcChatlist * -Context::getChatlist() +Context::getChatlist(int flags) { - dc_chatlist_t *chatlist = dc_get_chatlist(m_context, 0, NULL, 0); + dc_chatlist_t *chatlist = dc_get_chatlist(m_context, flags, NULL, 0); return new DcChatlist{chatlist}; } @@ -26,7 +26,7 @@ public: Q_INVOKABLE void startIo(); Q_INVOKABLE void stopIo(); Q_INVOKABLE void maybeNetwork(); - Q_INVOKABLE DcChatlist *getChatlist(); + Q_INVOKABLE DcChatlist *getChatlist(int flags); Q_INVOKABLE void setChatVisibility(uint32_t chatId, int visibility); Q_INVOKABLE void deleteChat(uint32_t chatId); Q_INVOKABLE QString getChatEncrinfo(uint32_t chatId); diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index a92e7b8..9bc9c5a 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -13,6 +13,8 @@ Kirigami.ScrollablePage { required property DcContext context required property DcAccountsEventEmitter eventEmitter + property bool archivedOnly: false + Connections { target: chatlistPage.eventEmitter @@ -51,7 +53,7 @@ Kirigami.ScrollablePage { } function updateChatlist() { - let chatlist = chatlistPage.context.getChatlist() + let chatlist = chatlistPage.context.getChatlist(chatlistPage.archivedOnly ? 1 : 0) // Merge new chatlist with existing one. // To preserve selected item, we do not simply clear and fill |