diff options
author | link2xt <link2xt@testrun.org> | 2020-09-12 14:10:13 +0300 |
---|---|---|
committer | link2xt <link2xt@testrun.org> | 2020-10-03 00:20:03 +0300 |
commit | b8762ddb38dd975b0acb217b793594dfed83a824 (patch) | |
tree | 23ccefbba703fed6c07acce82ff72e32ba77c9ba /chatlist.cpp | |
download | kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.tar.gz kdeltachat-b8762ddb38dd975b0acb217b793594dfed83a824.zip |
Initial commit
Diffstat (limited to 'chatlist.cpp')
-rw-r--r-- | chatlist.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/chatlist.cpp b/chatlist.cpp new file mode 100644 index 0000000..0f95245 --- /dev/null +++ b/chatlist.cpp @@ -0,0 +1,42 @@ +#include "chatlist.h" +#include "lot.h" + +DcChatlist::DcChatlist(QObject *parent) + : QObject{parent} +{ +} + +DcChatlist::DcChatlist(dc_chatlist_t *chatlist, QObject *parent) + : QObject{parent} + , m_chatlist{chatlist} +{ +} + +DcChatlist::~DcChatlist() +{ + dc_chatlist_unref(m_chatlist); +} + +size_t +DcChatlist::getChatCount() const +{ + return dc_chatlist_get_cnt(m_chatlist); +} + +uint32_t +DcChatlist::getChatId(size_t index) const +{ + return dc_chatlist_get_chat_id(m_chatlist, index); +} + +uint32_t +DcChatlist::getMsgId(size_t index) const +{ + return dc_chatlist_get_msg_id(m_chatlist, index); +} + +DcLot * +DcChatlist::getSummary(size_t index) const +{ + return new DcLot{dc_chatlist_get_summary(m_chatlist, index, NULL)}; +} |