summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/misc.cpp
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2017-01-11 01:18:09 +0500
committerElzorFox <elzorfox@ya.ru>2017-01-11 01:18:09 +0500
commit7aed63a94c430094a66006ed459bfb8cbd7ff5f2 (patch)
treec4df980c9d3522134bfdc8e18700a8c93af8c9c3 /protocols/VKontakte/src/misc.cpp
parent83402fe2934d403c8d3a436baed5261cd315dc85 (diff)
Revert "VKontakte: no more write to db if oldValue == newValue"
This reverts commit 77cccf9d4b13d9fad437eaf6361cec016a4ce27c.
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r--protocols/VKontakte/src/misc.cpp67
1 files changed, 1 insertions, 66 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 4637498c33..f8f3bec513 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -1334,7 +1334,7 @@ void CVkProto::SetInvisible(MCONTACT hContact)
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) {
setWord(hContact, "Status", ID_STATUS_INVISIBLE);
SetMirVer(hContact, 1);
- DBSetDWord(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_INVISIBLE);
+ db_set_dw(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_INVISIBLE);
debugLogA("CVkProto::SetInvisible %d set ID_STATUS_INVISIBLE", getDword(hContact, "ID", VK_INVALID_USER));
}
time_t now = time(NULL);
@@ -1484,68 +1484,3 @@ void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType)
db_event_add(hContact, &dbei);
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-bool CVkProto::DBSetByte(MCONTACT hContact, LPCSTR szKey, BYTE bValue, BYTE bDefaultValue)
-{
- return DBSetByte(hContact, m_szModuleName, szKey, bValue, bDefaultValue);
-}
-
-bool CVkProto::DBSetByte(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, BYTE bValue, BYTE bDefaultValue)
-{
- DWORD bOldValue = db_get_b(hContact, szModuleName, szKey, bDefaultValue);
-
- if (bOldValue == bValue)
- return false;
-
- db_set_b(hContact, szModuleName, szKey, bValue);
- return true;
-}
-
-bool CVkProto::DBSetWord(MCONTACT hContact, LPCSTR szKey, WORD wValue, WORD wDefaultValue)
-{
- return DBSetWord(hContact, m_szModuleName, szKey, wValue, wDefaultValue);
-}
-
-bool CVkProto::DBSetWord(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, WORD wValue, WORD wDefaultValue)
-{
- DWORD wOldValue = db_get_w(hContact, szModuleName, szKey, wDefaultValue);
-
- if (wOldValue == wValue)
- return false;
-
- db_set_w(hContact, szModuleName, szKey, wValue);
- return true;
-}
-
-bool CVkProto::DBSetDWord(MCONTACT hContact, LPCSTR szKey, DWORD dwValue, DWORD dwDefaultValue)
-{
- return DBSetDWord(hContact, m_szModuleName, szKey, dwValue, dwDefaultValue);
-}
-
-bool CVkProto::DBSetDWord(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, DWORD dwValue, DWORD dwDefaultValue)
-{
- DWORD dwOldValue = db_get_dw(hContact, szModuleName, szKey, dwDefaultValue);
-
- if (dwOldValue == dwValue)
- return false;
-
- db_set_dw(hContact, szModuleName, szKey, dwValue);
- return true;
-}
-
-bool CVkProto::DBSetWString(MCONTACT hContact, LPCSTR szKey, LPCWSTR wszValue)
-{
- return DBSetWString(hContact, m_szModuleName, szKey, wszValue);
-}
-
-bool CVkProto::DBSetWString(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, LPCWSTR wszValue)
-{
- CMStringW wszOldValue(ptrW(db_get_wsa(hContact, szModuleName, szKey)));
-
- if (wszOldValue == wszValue)
- return false;
-
- db_set_ws(hContact, szModuleName, szKey, wszValue);
- return true;
-} \ No newline at end of file