diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-05 11:10:32 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2015-02-05 11:10:32 +0000 |
commit | 6c5b2ecc6f9e1a7968e4eab4d2e1eeed4f82d1f0 (patch) | |
tree | f63019e4dd418ba6357d55d1b690f05820745dcc /protocols/VKontakte/src/misc.cpp | |
parent | dfe76cf65e6f20d5f9c92982a241ffecf6bb3405 (diff) |
VKontakte:
fix(???) for empty contact name on friend request (attempt 3)
fix memory leaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@12006 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte/src/misc.cpp')
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index ebe357b40b..414d9fc65a 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -512,13 +512,28 @@ void CVkProto::ApplyCookies(AsyncHttpRequest *pReq) /////////////////////////////////////////////////////////////////////////////////////////
+void __cdecl CVkProto::DBAddAuthRequestThread(void *p)
+{
+ MCONTACT hContact = (MCONTACT)p;
+ if (hContact == NULL || hContact == INVALID_CONTACT_ID || !IsOnline())
+ return;
+
+ for (int i = 0; i < MAX_RETRIES && CMString(ptrT(db_get_tsa(hContact, m_szModuleName, "Nick"))).IsEmpty(); i++) {
+ Sleep(1500);
+
+ if (!IsOnline())
+ return;
+ }
+ DBAddAuthRequest(hContact);
+}
+
void CVkProto::DBAddAuthRequest(const MCONTACT hContact)
{
debugLogA("CVkProto::DBAddAuthRequest");
- CMString tszNick = db_get_sa(hContact, m_szModuleName, "Nick");
- CMString tszFirstName = db_get_sa(hContact, m_szModuleName, "FirstName");
- CMString tszLastName = db_get_sa(hContact, m_szModuleName, "LastName");
+ CMString tszNick = ptrT(db_get_tsa(hContact, m_szModuleName, "Nick"));
+ CMString tszFirstName = ptrT(db_get_tsa(hContact, m_szModuleName, "FirstName"));
+ CMString tszLastName = ptrT(db_get_tsa(hContact, m_szModuleName, "LastName"));
ptrA szNick(mir_utf8encodeT(tszNick.GetBuffer()));
ptrA szFirstName(mir_utf8encodeT(tszFirstName.GetBuffer()));
@@ -591,7 +606,7 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform) }
CMString MirVer, OldMirVer;
- OldMirVer = db_get_sa(hContact, m_szModuleName, "MirVer");
+ OldMirVer = ptrT(db_get_tsa(hContact, m_szModuleName, "MirVer"));
bool bSetFlag = true;
switch (platform) {
|