From 763272b5a51b73eedb013c209ad256f85afc8fd2 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 10 May 2013 10:51:40 +0000 Subject: - fixed contacts duplicating on login git-svn-id: http://svn.miranda-ng.org/main/trunk@4620 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'protocols/Skype/src') diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index 041f76eaa2..6ef7f0cf1b 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -159,17 +159,14 @@ bool CSkypeProto::IsProtoContact(HANDLE hContact) HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid) { - HANDLE hContact = ::db_find_first(); - while (hContact) + for (HANDLE hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName)) { - if (this->IsProtoContact(hContact) && !this->IsChatRoom(hContact)) + if ( !this->IsChatRoom(hContact)) { mir_ptr contactSid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_LOGIN)); - if ( lstrcmp(contactSid, sid) == 0) + if (::wcsicmp(contactSid, sid) == 0) return hContact; } - - hContact = ::db_find_next(hContact); } return 0; @@ -263,7 +260,7 @@ void __cdecl CSkypeProto::LoadContactList(void* data) contact->SetOnContactChangedCallback( (CContact::OnContactChanged)&CSkypeProto::OnContactChanged, this); - + mir_ptr sid( ::mir_utf8decodeW(contact->GetSid())); HANDLE hContact = this->AddContact(contact); if ( !isFirstLoad) -- cgit v1.2.3