diff options
author | ElzorFox <elzorfox@ya.ru> | 2017-01-10 13:17:53 +0500 |
---|---|---|
committer | ElzorFox <elzorfox@ya.ru> | 2017-01-10 13:17:53 +0500 |
commit | 77cccf9d4b13d9fad437eaf6361cec016a4ce27c (patch) | |
tree | a18f22cccead332e7eca0ec5418c5dd8f2348c29 /protocols | |
parent | f124c479945d8d0db785b4259a2f41e2998fac73 (diff) |
VKontakte: no more write to db if oldValue == newValue
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 67 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 14 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 10 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_status.cpp | 6 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 88 |
7 files changed, 126 insertions, 65 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index f8f3bec513..4637498c33 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);
- db_set_dw(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_INVISIBLE);
+ DBSetDWord(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,3 +1484,68 @@ 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 diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index 79ee8ff0ed..e5b9b3bc6c 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -68,7 +68,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) Chat_GetInfo(&gci);
c->m_hContact = gci.hContact;
- setWString(gci.hContact, "Nick", wszTitle);
+ DBSetWString(gci.hContact, "Nick", wszTitle);
m_chats.insert(c);
for (int i = _countof(sttStatuses)-1; i >= 0; i--)
@@ -77,7 +77,7 @@ CVkChatInfo* CVkProto::AppendChat(int id, const JSONNode &jnDlg) setDword(gci.hContact, "vk_chat_id", id);
CMStringW wszHomepage(FORMAT, L"https://vk.com/im?sel=c%d", id);
- setWString(gci.hContact, "Homepage", wszHomepage);
+ DBSetWString(gci.hContact, "Homepage", wszHomepage);
db_unset(gci.hContact, m_szModuleName, "off");
@@ -233,9 +233,9 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe continue;
hContact = SetContactInfo(jnUser, true);
- db_set_b(hContact, "CList", "Hidden", 1);
- db_set_b(hContact, "CList", "NotOnList", 1);
- db_set_dw(hContact, "Ignore", "Mask1", 0);
+ DBSetByte(hContact, "CList", "Hidden", 1);
+ DBSetByte(hContact, "CList", "NotOnList", 1);
+ DBSetDWord(hContact, "Ignore", "Mask1", 0);
}
const JSONNode &jnMsgs = jnResponse["msgs"];
@@ -272,7 +272,7 @@ void CVkProto::SetChatTitle(CVkChatInfo *cc, LPCWSTR wszTopic) return;
cc->m_wszTopic = mir_wstrdup(wszTopic);
- setWString(cc->m_hContact, "Nick", wszTopic);
+ DBSetWString(cc->m_hContact, "Nick", wszTopic);
Chat_ChangeSessionName(m_szModuleName, cc->m_wszId, wszTopic);
}
@@ -794,7 +794,7 @@ void CVkProto::NickMenuHook(CVkChatInfo *cc, GCHOOK *gch) Chat_Event(&gce);
cu->m_wszNick = mir_wstrdup(wszNewNick);
- setWString(cc->m_hContact, CMStringA(FORMAT, "nick%d", cu->m_uid), wszNewNick);
+ DBSetWString(cc->m_hContact, CMStringA(FORMAT, "nick%d", cu->m_uid), wszNewNick);
}
break;
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index ac23773168..85dcdd5343 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -40,10 +40,8 @@ void CVkProto::AddFeedSpecialUser() setWString(hContact, "Homepage", L"https://vk.com/feed");
}
- if (getWord(hContact, "Status") != ID_STATUS_ONLINE)
- setWord(hContact, "Status", ID_STATUS_ONLINE);
+ DBSetWord(hContact, "Status", ID_STATUS_ONLINE, ID_STATUS_OFFLINE);
SetMirVer(hContact, 7);
-
}
void CVkProto::AddFeedEvent(CVKNewsItem& vkNewsItem)
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 94bef34949..f8dec80402 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -73,7 +73,7 @@ CVkProto::CVkProto(const char *szModuleName, const wchar_t *pwszUserName) : Clist_GroupCreate(NULL, m_vkOptions.pwszDefaultGroup);
CMStringA szListeningTo(FORMAT, "%sEnabled", m_szModuleName);
- db_set_b(NULL, "ListeningTo", szListeningTo, m_vkOptions.iMusicSendMetod == 0 ? 0 : 1);
+ DBSetByte(NULL, "ListeningTo", szListeningTo, m_vkOptions.iMusicSendMetod == 0 ? 0 : 1);
delSetting("InviteGroupIds");
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 84167b2a4f..215671eeaf 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -353,6 +353,16 @@ private: void SetInvisible(MCONTACT hContact);
CMStringW RemoveBBC(CMStringW& wszSrc);
void AddVkDeactivateEvent(MCONTACT hContact, CMStringW & wszType);
+
+ bool DBSetByte(MCONTACT hContact, LPCSTR szKey, BYTE bValue, BYTE bDefaultValue = 0);
+ bool DBSetByte(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, BYTE bValue, BYTE bDefaultValue = 0);
+ bool DBSetWord(MCONTACT hContact, LPCSTR szKey, WORD wValue, WORD wDefaultValue = 0);
+ bool DBSetWord(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, WORD wValue, WORD wDefaultValue = 0);
+ bool DBSetDWord(MCONTACT hContact, LPCSTR szKey, DWORD dwValue, DWORD dwDefaultValue = 0);
+ bool DBSetDWord(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, DWORD dwValue, DWORD dwDefaultValue = 0);
+ bool DBSetWString(MCONTACT hContact, LPCSTR szKey, LPCWSTR wszValue);
+ bool DBSetWString(MCONTACT hContact, LPCSTR szModuleName, LPCSTR szKey, LPCWSTR wszValue);
+
void InitQueue();
void UninitQueue();
void ExecuteRequest(AsyncHttpRequest*);
diff --git a/protocols/VKontakte/src/vk_status.cpp b/protocols/VKontakte/src/vk_status.cpp index d7503923df..f8b8558ed1 100644 --- a/protocols/VKontakte/src/vk_status.cpp +++ b/protocols/VKontakte/src/vk_status.cpp @@ -144,7 +144,7 @@ void CVkProto::OnReceiveStatusMsg(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR return;
RetrieveStatusMsg(wszNewStatusMsg);
- setWString("OldStatusMsg", pwszOldStatusMsg);
+ DBSetWString(NULL, "OldStatusMsg", pwszOldStatusMsg);
}
void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
@@ -161,7 +161,7 @@ void CVkProto::OnReceiveStatus(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) if (!jnAudio) {
CMStringW wszStatusText(jnResponse["text"].as_mstring());
if (wszStatusText[0] != wchar_t(9835))
- setWString("OldStatusMsg", wszStatusText);
+ DBSetWString(NULL, "OldStatusMsg", wszStatusText);
}
}
@@ -245,7 +245,7 @@ INT_PTR __cdecl CVkProto::SvcSetListeningTo(WPARAM, LPARAM lParam) wszListeningTo.Format(L"%s - %s",
pliInfo->ptszArtist ? pliInfo->ptszArtist : L"",
pliInfo->ptszTitle ? pliInfo->ptszTitle : L"");
- setWString("ListeningTo", wszListeningTo);
+ DBSetWString(NULL ,"ListeningTo", wszListeningTo);
}
RetrieveStatusMusic(wszListeningTo);
return 0;
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 8e1c6b2b6a..747348fd7a 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -287,19 +287,19 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) wszValue = jnItem["first_name"].as_mstring();
if (!wszValue.IsEmpty()) {
- setWString(hContact, "FirstName", wszValue);
+ DBSetWString(hContact, "FirstName", wszValue);
wszNick.Append(wszValue);
wszNick.AppendChar(' ');
}
wszValue = jnItem["last_name"].as_mstring();
if (!wszValue.IsEmpty()) {
- setWString(hContact, "LastName", wszValue);
+ DBSetWString(hContact, "LastName", wszValue);
wszNick.Append(wszValue);
}
if (!wszNick.IsEmpty())
- setWString(hContact, "Nick", wszNick);
+ DBSetWString(hContact, "Nick", wszNick);
wszValue = jnItem["deactivated"].as_mstring();
CMStringW wszOldDeactivated(ptrW(db_get_wsa(hContact, m_szModuleName, "Deactivated")));
@@ -316,7 +316,7 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) int sex = jnItem["sex"].as_int();
if (sex)
- setByte(hContact, "Gender", sex == 2 ? 'M' : 'F');
+ DBSetByte(hContact, "Gender", sex == 2 ? 'M' : 'F');
wszValue = jnItem["bdate"].as_mstring();
if (!wszValue.IsEmpty()) {
@@ -324,9 +324,9 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) iReadCount = swscanf(wszValue, L"%d.%d.%d", &d, &m, &y);
if (iReadCount > 1) {
if (iReadCount == 3)
- setWord(hContact, "BirthYear", y);
- setByte(hContact, "BirthDay", d);
- setByte(hContact, "BirthMonth", m);
+ DBSetWord(hContact, "BirthYear", y);
+ DBSetByte(hContact, "BirthDay", d);
+ DBSetByte(hContact, "BirthMonth", m);
}
}
@@ -342,17 +342,16 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) int iOldLastSeen = db_get_dw(hContact, "BuddyExpectator", "LastSeen");
if (iLastSeen && iLastSeen > iOldLastSeen) {
db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)iLastSeen);
- db_set_w(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
+ DBSetDWord(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
}
}
int iNewStatus = (jnItem["online"].as_int() == 0) ? ID_STATUS_OFFLINE : ID_STATUS_ONLINE;
- if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != iNewStatus)
- setWord(hContact, "Status", iNewStatus);
+ DBSetWord(hContact, "Status", iNewStatus, ID_STATUS_OFFLINE);
if (iNewStatus == ID_STATUS_ONLINE) {
db_set_dw(hContact, "BuddyExpectator", "LastSeen", (DWORD)time(NULL));
- db_set_dw(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
+ DBSetDWord(hContact, "BuddyExpectator", "LastStatus", ID_STATUS_ONLINE);
int online_app = _wtoi(jnItem["online_app"].as_mstring());
int online_mobile = jnItem["online_mobile"].as_int();
@@ -368,32 +367,27 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) SetMirVer(hContact, -1); // unset MinVer
if ((iValue = jnItem["timezone"].as_int()) != 0)
- setByte(hContact, "Timezone", iValue * -2);
+ DBSetByte(hContact, "Timezone", iValue * -2);
wszValue = jnItem["mobile_phone"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "Cellular", wszValue);
+ DBSetWString(hContact, "Cellular", wszValue);
wszValue = jnItem["home_phone"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "Phone", wszValue);
+ DBSetWString(hContact, "Phone", wszValue);
wszValue = jnItem["status"].as_mstring();
- CMStringW wszOldStatus(ptrW(db_get_wsa(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg")));
- if (wszValue != wszOldStatus)
- db_set_ws(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", wszValue);
+ DBSetWString(hContact, hContact ? "CList" : m_szModuleName, "StatusMsg", wszValue);
- CMStringW wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
const JSONNode &jnAudio = jnItem["status_audio"];
if (jnAudio) {
CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
- if (wszListeningTo != wszOldListeningTo) {
- setWString(hContact, "ListeningTo", wszListeningTo);
- setWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
- }
+ if (DBSetWString(hContact, "ListeningTo", wszListeningTo))
+ DBSetWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
}
else if (wszValue[0] == wchar_t(9835) && wszValue.GetLength() > 2) {
- setWString(hContact, "ListeningTo", &(wszValue.GetBuffer())[2]);
+ DBSetWString(hContact, "ListeningTo", &(wszValue.GetBuffer())[2]);
db_unset(hContact, m_szModuleName, "AudioUrl");
}
else {
@@ -405,21 +399,21 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) if (jnCountry) {
wszValue = jnCountry["title"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "Country", wszValue);
+ DBSetWString(hContact, "Country", wszValue);
}
const JSONNode &jnCity = jnItem["city"];
if (jnCity) {
wszValue = jnCity["title"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "City", wszValue);
+ DBSetWString(hContact, "City", wszValue);
}
// MaritalStatus
BYTE cMaritalStatus[] = {0, 10, 11, 12, 20, 70, 50, 60, 80};
if (jnItem["relation"] && jnItem["relation"].as_int() < _countof(cMaritalStatus))
- setByte(hContact, "MaritalStatus", cMaritalStatus[jnItem["relation"].as_int()]);
+ DBSetByte(hContact, "MaritalStatus", cMaritalStatus[jnItem["relation"].as_int()]);
// interests, activities, music, movies, tv, books, games, quotes
CVKInteres vkInteres[] = {
@@ -443,8 +437,8 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) CMStringA InteresCat(FORMAT, "Interest%dCat", iInteres);
CMStringA InteresText(FORMAT, "Interest%dText", iInteres);
- setWString(hContact, InteresCat, vkInteres[i].pwszTranslate);
- setWString(hContact, InteresText, wszValue);
+ DBSetWString(hContact, InteresCat, vkInteres[i].pwszTranslate);
+ DBSetWString(hContact, InteresText, wszValue);
iInteres++;
@@ -466,14 +460,14 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) wszValue = jnItem["about"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "About", wszValue);
+ DBSetWString(hContact, "About", wszValue);
wszValue = jnItem["domain"].as_mstring();
if (!wszValue.IsEmpty()) {
- setWString(hContact, "domain", wszValue);
+ DBSetWString(hContact, "domain", wszValue);
CMStringW wszUrl("https://vk.com/");
wszUrl.Append(wszValue);
- setWString(hContact, "Homepage", wszUrl);
+ DBSetWString(hContact, "Homepage", wszUrl);
}
return hContact;
@@ -673,25 +667,24 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR wszValue = jnItem["name"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "Nick", wszValue);
+ DBSetWString(hContact, "Nick", wszValue);
- if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE)
- setWord(hContact, "Status", ID_STATUS_ONLINE);
+ DBSetWord(hContact, "Status", ID_STATUS_ONLINE, ID_STATUS_OFFLINE);
- setByte(hContact, "Auth", !bIsMember);
- setByte(hContact, "friend", bIsMember);
- setByte(hContact, "IsGroup", 1);
+ DBSetByte(hContact, "Auth", !bIsMember);
+ DBSetByte(hContact, "friend", bIsMember);
+ DBSetByte(hContact, "IsGroup", 1);
wszValue = jnItem["screen_name"].as_mstring();
if (!wszValue.IsEmpty()) {
- setWString(hContact, "domain", wszValue);
+ DBSetWString(hContact, "domain", wszValue);
wszValue = L"https://vk.com/" + wszValue;
- setWString(hContact, "Homepage", wszValue);
+ DBSetWString(hContact, "Homepage", wszValue);
}
wszValue = jnItem["description"].as_mstring();
if (!wszValue.IsEmpty())
- setWString(hContact, "About", wszValue);
+ DBSetWString(hContact, "About", wszValue);
wszValue = jnItem["photo_100"].as_mstring();
if (!wszValue.IsEmpty()) {
@@ -700,21 +693,16 @@ void CVkProto::OnReceiveGroupInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR }
wszValue = jnItem["status"].as_mstring();
- CMStringW wszOldStatus(ptrW(db_get_wsa(hContact, "CList", "StatusMsg")));
- if (wszValue != wszOldStatus)
- db_set_ws(hContact, "CList", "StatusMsg", wszValue);
+ DBSetWString(hContact, "CList", "StatusMsg", wszValue);
- CMStringW wszOldListeningTo(ptrW(db_get_wsa(hContact, m_szModuleName, "ListeningTo")));
const JSONNode &jnAudio = jnItem["status_audio"];
if (jnAudio) {
CMStringW wszListeningTo(FORMAT, L"%s - %s", jnAudio["artist"].as_mstring(), jnAudio["title"].as_mstring());
- if (wszListeningTo != wszOldListeningTo) {
- setWString(hContact, "ListeningTo", wszListeningTo);
- setWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
- }
+ if (DBSetWString(hContact, "ListeningTo", wszListeningTo))
+ DBSetWString(hContact, "AudioUrl", jnAudio["url"].as_mstring());
}
else if (wszValue[0] == wchar_t(9835) && wszValue.GetLength() > 2) {
- setWString(hContact, "ListeningTo", &(wszValue.GetBuffer())[2]);
+ DBSetWString(hContact, "ListeningTo", &(wszValue.GetBuffer())[2]);
db_unset(hContact, m_szModuleName, "AudioUrl");
}
else {
@@ -770,7 +758,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq continue;
arContacts.remove((HANDLE)hContact);
- setByte(hContact, "Auth", 0);
+ DBSetByte(hContact, "Auth", 0);
}
if (bCleanContacts)
|