summaryrefslogtreecommitdiff
path: root/protocols/Icq10/src/utils.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-03 22:08:25 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-03 22:08:25 +0300
commit411df60e2845f9ddfe3e68043d603d64c3bf62a5 (patch)
tree635f5705deb63379b4b30f6aa21414778b086228 /protocols/Icq10/src/utils.cpp
parentca6eff4cc054b80e91b98ad25a30515a54084c3e (diff)
fixes #1670 (ICQ10: server history loading)
Diffstat (limited to 'protocols/Icq10/src/utils.cpp')
-rw-r--r--protocols/Icq10/src/utils.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/Icq10/src/utils.cpp b/protocols/Icq10/src/utils.cpp
index f745387742..17f5510142 100644
--- a/protocols/Icq10/src/utils.cpp
+++ b/protocols/Icq10/src/utils.cpp
@@ -202,3 +202,24 @@ int StatusFromString(const CMStringW &wszStatus)
return ID_STATUS_OFFLINE;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+__int64 CIcqProto::getId(MCONTACT hContact, const char *szSetting)
+{
+ DBVARIANT dbv;
+ dbv.type = DBVT_BLOB;
+ if (db_get(hContact, m_szModuleName, szSetting, &dbv))
+ return 0;
+
+ __int64 result = (dbv.cpbVal == sizeof(__int64)) ? *(__int64*)dbv.pbVal : 0;
+ db_free(&dbv);
+ return result;
+}
+
+void CIcqProto::setId(MCONTACT hContact, const char *szSetting, __int64 iValue)
+{
+ __int64 oldVal = getId(hContact, szSetting);
+ if (oldVal != iValue)
+ db_set_blob(hContact, m_szModuleName, szSetting, &iValue, sizeof(iValue));
+}