aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2020-11-05 23:28:54 +0300
committerlink2xt <link2xt@testrun.org>2020-11-05 23:29:01 +0300
commita441a4ae1223e745c41ad7b9a111ad4401125d16 (patch)
treec78a9658cc1141cac62d098715bd15632b88e8a3
parentfe89c7a4ff760564f3cdbcd8e27c04eadd9f79d8 (diff)
downloadkdeltachat-a441a4ae1223e745c41ad7b9a111ad4401125d16.tar.gz
kdeltachat-a441a4ae1223e745c41ad7b9a111ad4401125d16.zip
Implement Context.getConfig()
-rw-r--r--context.cpp10
-rw-r--r--context.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/context.cpp b/context.cpp
index ad5c2c9..1e44f7e 100644
--- a/context.cpp
+++ b/context.cpp
@@ -86,6 +86,16 @@ Context::getBlobdir()
}
QString
+Context::getConfig(QString key)
+{
+ QByteArray utf8Key = key.toUtf8();
+ char *value = dc_get_config(m_context, utf8Key.constData());
+ QString result{value};
+ dc_str_unref(value);
+ return result;
+}
+
+QString
Context::getMessageInfo(uint32_t msgId)
{
char *info = dc_get_msg_info(m_context, msgId);
diff --git a/context.h b/context.h
index c063709..98c4196 100644
--- a/context.h
+++ b/context.h
@@ -29,6 +29,7 @@ public:
Q_INVOKABLE DcContact *getContact(uint32_t contactId);
Q_INVOKABLE uint32_t sendTextMessage(uint32_t chatId, QString textToSend);
QString getBlobdir();
+ Q_INVOKABLE QString getConfig(QString key);
Q_INVOKABLE QString getMessageInfo(uint32_t msgId);
private: