summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_contacts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-05-10 15:07:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-05-10 15:07:47 +0000
commit32cc6d62a154d5724c40085f22747df2ee2ff4cb (patch)
treef47241b283331f42b0955de792493e8139925a73 /protocols/Skype/src/skype_contacts.cpp
parent763272b5a51b73eedb013c209ad256f85afc8fd2 (diff)
- fixed several issues in own details saving
- fixed issues with contacts look cycle in db - fixed freez offline status after login error - other few bugs git-svn-id: http://svn.miranda-ng.org/main/trunk@4621 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_contacts.cpp')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index 6ef7f0cf1b..e64194bdd5 100644
--- a/protocols/Skype/src/skype_contacts.cpp
+++ b/protocols/Skype/src/skype_contacts.cpp
@@ -164,7 +164,7 @@ HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid)
if ( !this->IsChatRoom(hContact))
{
mir_ptr<wchar_t> contactSid( ::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_LOGIN));
- if (::wcsicmp(contactSid, sid) == 0)
+ if (::lstrcmpi(contactSid, sid) == 0)
return hContact;
}
}
@@ -205,7 +205,7 @@ HANDLE CSkypeProto::AddContact(CContact::Ref contact)
hContact = (HANDLE)::CallService(MS_DB_CONTACT_ADD, 0, 0);
::CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)this->m_szModuleName);
- mir_ptr<wchar_t> nick( ::mir_utf8decodeW(contact->GetNick()));
+ mir_ptr<wchar_t> nick(::mir_utf8decodeW(contact->GetNick()));
switch(availability) {
case CContact::SKYPEOUT:
@@ -243,7 +243,10 @@ HANDLE CSkypeProto::AddContact(CContact::Ref contact)
void __cdecl CSkypeProto::LoadContactList(void* data)
{
+ ::EnterCriticalSection(&this->cl_loading);
+
this->Log(L"Updating contacts list");
+
bool isFirstLoad = data != NULL;
g_skype->GetHardwiredContactGroup(CContactGroup::ALL_BUDDIES, this->commonList);
@@ -260,7 +263,7 @@ void __cdecl CSkypeProto::LoadContactList(void* data)
contact->SetOnContactChangedCallback(
(CContact::OnContactChanged)&CSkypeProto::OnContactChanged,
this);
- mir_ptr<wchar_t> sid( ::mir_utf8decodeW(contact->GetSid()));
+
HANDLE hContact = this->AddContact(contact);
if ( !isFirstLoad)
@@ -272,16 +275,15 @@ void __cdecl CSkypeProto::LoadContactList(void* data)
mir_ptr<wchar_t> nick( ::db_get_wsa(hContact, "CList", "MyHandle"));
if ( !nick || !::wcslen(nick))
{
- SEString data;
- contact->GetPropFullname(data);
-
- nick = ::mir_utf8decodeW(data);
+ nick = ::mir_utf8decodeW(contact->GetNick());
::db_set_ws(hContact, "CList", "MyHandle", nick);
}
this->UpdateProfile(contact.fetch(), hContact);
}
}
+
+ ::LeaveCriticalSection(&this->cl_loading);
}
void __cdecl CSkypeProto::LoadChatList(void*)
@@ -305,13 +307,6 @@ void __cdecl CSkypeProto::LoadChatList(void*)
this->JoinToChat(conversation, false);
}
}
-
- /*CConversation::Refs conversations;
- g_skype->GetConversationList(conversations);
- for (uint i = 0; i < conversations.size(); i++)
- {
- conversations[i]->Delete();
- }*/
}
void __cdecl CSkypeProto::LoadAuthWaitList(void*)
@@ -346,13 +341,10 @@ bool CSkypeProto::IsContactOnline(HANDLE hContact)
void CSkypeProto::SetAllContactStatus(int status)
{
- 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) && ::db_get_b(hContact, this->m_szModuleName, "IsSkypeOut", 0) == 0)
+ if (::db_get_b(hContact, this->m_szModuleName, "IsSkypeOut", 0) == 0)
::db_set_w(hContact, this->m_szModuleName, SKYPE_SETTINGS_STATUS, status);
-
- hContact = ::db_find_next(hContact);
}
}