diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-05 19:21:28 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-05 19:21:28 +0300 |
commit | a289263bd2d74f89c4ea119149bf31c96d29a6a8 (patch) | |
tree | fa28801a4b637983fde8b1c369b4ba09ff291401 | |
parent | e84083c4ba1f1e68b0bc76939f2d0902d3c03c9e (diff) |
getBlob went to the core
-rw-r--r-- | include/m_protoint.h | 3 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 230744 -> 231490 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 227002 -> 227768 bytes | |||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/proto_utils.cpp | 24 |
6 files changed, 31 insertions, 0 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h index 5fc087e6e8..1eea83eaa8 100644 --- a/include/m_protoint.h +++ b/include/m_protoint.h @@ -107,6 +107,9 @@ public: __forceinline bool getBool(MCONTACT hContact, const char *name, bool defaultValue = false) { return db_get_b(hContact, m_szModuleName, name, defaultValue) != 0; } + MBinBuffer getBlob(const char *pSetting); + MBinBuffer getBlob(MCONTACT hContact, const char *pSetting); + __forceinline bool isChatRoom(MCONTACT hContact) { return getBool(hContact, "ChatRoom", false); } __forceinline int getByte(const char *name, uint8_t defaultValue = 0) { diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 863f6f6705..2b562bc3b5 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex cd39df943f..4f2ee2f598 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib 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 @@ -120,6 +120,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
MIR_APP_DLL(void) ProtoCreateService(PROTO_INTERFACE *pThis, const char* szService, ProtoServiceFunc serviceProc)
|