summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/contacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-02 21:23:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-02 21:23:05 +0000
commit885a3fff9be755485bdcabc0a48b4e399f0b89d8 (patch)
treea563de6b3a768986f05f224f5a35d9da122cce45 /protocols/WhatsApp/src/contacts.cpp
parent12b26224f66112237a13a139bd863676d0e8059c (diff)
fix for the endless recursion in Wassup
git-svn-id: http://svn.miranda-ng.org/main/trunk@4866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/contacts.cpp')
-rw-r--r--protocols/WhatsApp/src/contacts.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp
index 337e62cc9e..f412d6be56 100644
--- a/protocols/WhatsApp/src/contacts.cpp
+++ b/protocols/WhatsApp/src/contacts.cpp
@@ -125,11 +125,8 @@ HANDLE WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
// Cache
std::map<string, HANDLE>::iterator it = this->hContactByJid.find(phoneNumber);
if (it != this->hContactByJid.end())
- {
return it->second;
- }
- const char* id;
const char* idForContact = "ID";
const char* idForChat = "ChatRoomID";
@@ -140,7 +137,7 @@ HANDLE WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
if(!IsMyContact(hContact, true))
continue;
- id = db_get_b(hContact, m_szModuleName, "ChatRoom", 0) > 0 ? idForChat : idForContact;
+ const char* id = db_get_b(hContact, m_szModuleName, "ChatRoom", 0) > 0 ? idForChat : idForContact;
DBVARIANT dbv;
if( !db_get_s(hContact,m_szModuleName, id,&dbv, DBVT_ASCIIZ))
@@ -151,10 +148,8 @@ HANDLE WhatsAppProto::ContactIDToHContact(const std::string& phoneNumber)
this->hContactByJid[phoneNumber] = hContact;
return hContact;
}
- else
- {
- db_free(&dbv);
- }
+
+ db_free(&dbv);
}
}