From a289263bd2d74f89c4ea119149bf31c96d29a6a8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 5 Oct 2022 19:21:28 +0300 Subject: getBlob went to the core --- src/mir_app/src/mir_app.def | 2 ++ src/mir_app/src/mir_app64.def | 2 ++ src/mir_app/src/proto_utils.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) (limited to 'src') diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 39e0e08b34..a7a3b3312b 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -807,3 +807,5 @@ Srmm_CreateHotkey @886 NONAME ?bStripFormat@Chat@@3V?$CMOption@_N@@A @908 NONAME ?bTimeStampEventColour@Chat@@3V?$CMOption@_N@@A @909 NONAME ?bTopicOnClist@Chat@@3V?$CMOption@_N@@A @910 NONAME +?getBlob@PROTO_INTERFACE@@QAE?AVMBinBuffer@@IPBD@Z @911 NONAME +?getBlob@PROTO_INTERFACE@@QAE?AVMBinBuffer@@PBD@Z @912 NONAME diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 2a03307191..7cfbe15e28 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -807,3 +807,5 @@ Srmm_CreateHotkey @886 NONAME ?bStripFormat@Chat@@3V?$CMOption@_N@@A @908 NONAME ?bTimeStampEventColour@Chat@@3V?$CMOption@_N@@A @909 NONAME ?bTopicOnClist@Chat@@3V?$CMOption@_N@@A @910 NONAME +?getBlob@PROTO_INTERFACE@@QEAA?AVMBinBuffer@@IPEBD@Z @911 NONAME +?getBlob@PROTO_INTERFACE@@QEAA?AVMBinBuffer@@PEBD@Z @912 NONAME diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp index 1c2944120e..79bd7012fa 100644 --- a/src/mir_app/src/proto_utils.cpp +++ b/src/mir_app/src/proto_utils.cpp @@ -119,6 +119,30 @@ void PROTO_INTERFACE::setAllContactStatuses(int iStatus, bool bSkipChats) } } +///////////////////////////////////////////////////////////////////////////////////////// + +MBinBuffer PROTO_INTERFACE::getBlob(const char *pszSetting) +{ + MBinBuffer buf; + DBVARIANT dbv = {DBVT_BLOB}; + if (!db_get(0, m_szModuleName, pszSetting, &dbv)) { + buf.assign(dbv.pbVal, dbv.cpbVal); + db_free(&dbv); + } + return buf; +} + +MBinBuffer PROTO_INTERFACE::getBlob(MCONTACT hContact, const char *pszSetting) +{ + MBinBuffer buf; + DBVARIANT dbv = {DBVT_BLOB}; + if (!db_get(hContact, m_szModuleName, pszSetting, &dbv)) { + buf.assign(dbv.pbVal, dbv.cpbVal); + db_free(&dbv); + } + return buf; +} + ///////////////////////////////////////////////////////////////////////////////////////// // protocol services -- cgit v1.2.3