diff options
author | link2xt <link2xt@testrun.org> | 2021-03-01 00:21:55 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2021-03-01 00:21:55 +0300 |
commit | 88d351d4a271fa13f5ca43be01ab14267f04366a (patch) | |
tree | 790a2f95f3e0a3e0e9ad970b5834f6667c954c83 | |
parent | 3931e2843bd01740a861e98c39cd8f133867b989 (diff) | |
download | kdeltachat-88d351d4a271fa13f5ca43be01ab14267f04366a.tar.gz kdeltachat-88d351d4a271fa13f5ca43be01ab14267f04366a.zip |
Implement more context methods
-rw-r--r-- | context.cpp | 27 | ||||
-rw-r--r-- | context.h | 4 |
2 files changed, 31 insertions, 0 deletions
diff --git a/context.cpp b/context.cpp index 9c1ac94..6a7148a 100644 --- a/context.cpp +++ b/context.cpp @@ -62,6 +62,33 @@ Context::getChatlist() return new DcChatlist{chatlist}; } +void +Context::setChatVisibility(uint32_t chatId, int visibility) +{ + dc_set_chat_visibility(m_context, chatId, visibility); +} + +void +Context::deleteChat(uint32_t chatId) +{ + dc_delete_chat(m_context, chatId); +} + +QString +Context::getChatEncrinfo(uint32_t chatId) +{ + char *encrinfo = dc_get_chat_encrinfo(m_context, chatId); + QString result{encrinfo}; + dc_str_unref(encrinfo); + return result; +} + +uint32_t +Context::getChatEphemeralTimer(uint32_t chatId) +{ + return dc_get_chat_ephemeral_timer(m_context, chatId); +} + DcChat * Context::getChat(uint32_t chatId) { @@ -26,6 +26,10 @@ public: Q_INVOKABLE void stopIo(); Q_INVOKABLE void maybeNetwork(); Q_INVOKABLE DcChatlist *getChatlist(); + Q_INVOKABLE void setChatVisibility(uint32_t chatId, int visibility); + Q_INVOKABLE void deleteChat(uint32_t chatId); + Q_INVOKABLE QString getChatEncrinfo(uint32_t chatId); + Q_INVOKABLE uint32_t getChatEphemeralTimer(uint32_t chatId); Q_INVOKABLE DcChat *getChat(uint32_t chatId); Q_INVOKABLE QVariantList getMsgIdList(uint32_t chatId); Q_INVOKABLE int getFreshMsgCnt(uint32_t chatId); |