summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-09 20:51:56 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-09 20:51:56 +0000
commit22d948a4cd28ccf08008db597e4f7470c3a57219 (patch)
treec02c11079548e32703db659e7e1b390b3b171665 /protocols/SkypeWeb/src/skype_contacts.cpp
parent84261a1bda35dcdd1a4e56c3a573a169092f7363 (diff)
SkypeWeb: ugly contacts lookup hack
git-svn-id: http://svn.miranda-ng.org/main/trunk@12718 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_contacts.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp
index 4e34d1b2e0..e4a46cd0e3 100644
--- a/protocols/SkypeWeb/src/skype_contacts.cpp
+++ b/protocols/SkypeWeb/src/skype_contacts.cpp
@@ -47,15 +47,22 @@ MCONTACT CSkypeProto::GetContact(const char *skypename)
if (it != contactMap.end())
return it->second;
- for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
+ MCONTACT hContact = NULL;
+ if (contactMap.empty())
+ MCONTACT hContact = db_find_first(m_szModuleName);
+ else
+ {
+ hContact = db_find_next(lastMapContact, m_szModuleName);
+ }
+ for (; hContact; hContact = db_find_next(hContact, m_szModuleName))
{
std::string cSkypename = ptrA(getStringA(hContact, SKYPE_SETTINGS_ID));
if (!contactMap.count(cSkypename))
- contactMap[cSkypename] = hContact;
+ contactMap[cSkypename] = lastMapContact = hContact;
if (mir_strcmpi(skypename, cSkypename.c_str()) == 0)
- return hContact;
+ break;
}
- return NULL;
+ return hContact;
}
MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary)
@@ -66,7 +73,7 @@ MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary)
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, hContact, (LPARAM)m_szModuleName);
- contactMap[skypename] = hContact;
+ contactMap[skypename] = lastMapContact = hContact;
setString(hContact, SKYPE_SETTINGS_ID, skypename);