summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_contacts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype/src/skype_contacts.cpp')
-rw-r--r--protocols/Skype/src/skype_contacts.cpp47
1 files changed, 23 insertions, 24 deletions
diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp
index 33042e728d..325d70f508 100644
--- a/protocols/Skype/src/skype_contacts.cpp
+++ b/protocols/Skype/src/skype_contacts.cpp
@@ -1,6 +1,6 @@
#include "skype.h"
-void CSkypeProto::UpdateContactAuthState(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactAuthState(HCONTACT hContact, const ContactRef &contact)
{
uint newTS = 0;
contact->GetPropAuthreqTimestamp(newTS);
@@ -23,7 +23,7 @@ void CSkypeProto::UpdateContactAuthState(HANDLE hContact, const ContactRef &cont
}
}
-void CSkypeProto::UpdateContactStatus(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactStatus(HCONTACT hContact, const ContactRef &contact)
{
Contact::AVAILABILITY availability;
contact->GetPropAvailability(availability);
@@ -40,7 +40,7 @@ void CSkypeProto::UpdateContactStatus(HANDLE hContact, const ContactRef &contact
}
}
-void CSkypeProto::UpdateContactClient(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactClient(HCONTACT hContact, const ContactRef &contact)
{
bool isMobile = false;
contact->HasCapability(Contact::CAPABILITY_MOBILE_DEVICE, isMobile/*, true*/);
@@ -48,7 +48,7 @@ void CSkypeProto::UpdateContactClient(HANDLE hContact, const ContactRef &contact
this->setTString(hContact, "MirVer", isMobile ? L"SkypeMobile" : L"Skype");
}
-void CSkypeProto::UpdateContactOnlineSinceTime(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactOnlineSinceTime(HCONTACT hContact, const ContactRef &contact)
{
uint newTS = 0;
contact->GetPropLastonlineTimestamp(newTS);
@@ -57,7 +57,7 @@ void CSkypeProto::UpdateContactOnlineSinceTime(HANDLE hContact, const ContactRef
this->setDword(hContact, "OnlineSinceTS", newTS);
}
-void CSkypeProto::UpdateContactLastEventDate(HANDLE hContact, const ContactRef &contact)
+void CSkypeProto::UpdateContactLastEventDate(HCONTACT hContact, const ContactRef &contact)
{
uint newTS = 0;
contact->GetPropLastusedTimestamp(newTS);
@@ -71,7 +71,7 @@ void CSkypeProto::OnContactChanged(const ContactRef &contact, int prop)
SEString data;
contact->GetPropSkypename(data);
wchar_t *sid = ::mir_utf8decodeW(data);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
::mir_free(sid);
SEObject *contactObj = contact.fetch();
@@ -148,14 +148,14 @@ void CSkypeProto::OnContactListChanged(const ContactRef &contact)
}
}
-bool CSkypeProto::IsProtoContact(HANDLE hContact)
+bool CSkypeProto::IsProtoContact(HCONTACT hContact)
{
return ::lstrcmpiA(::GetContactProto(hContact), this->m_szModuleName) == 0;
}
-HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid)
+HCONTACT CSkypeProto::GetContactBySid(const wchar_t *sid)
{
- HANDLE hContact = NULL;
+ HCONTACT hContact = NULL;
::EnterCriticalSection(&this->contact_search_lock);
@@ -171,7 +171,7 @@ HANDLE CSkypeProto::GetContactBySid(const wchar_t *sid)
return hContact;
}
-HANDLE CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
+HCONTACT CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
{
// db_event_getContact
DWORD body[3];
@@ -180,34 +180,33 @@ HANDLE CSkypeProto::GetContactFromAuthEvent(HANDLE hEvent)
dbei.pBlob = (PBYTE)&body;
if (::db_event_get(hEvent, &dbei))
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
if (strcmp(dbei.szModule, this->m_szModuleName) != 0)
- return INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
return ::DbGetAuthEventContact(&dbei);
}
-HANDLE CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary)
+HCONTACT CSkypeProto::AddContact(CContact::Ref contact, bool isTemporary)
{
ptrW sid(::mir_utf8decodeW(contact->GetSid()));
CContact::AVAILABILITY availability;
contact->GetPropAvailability(availability);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
if ( !hContact)
{
- hContact = (HANDLE)::CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = (HCONTACT)::CallService(MS_DB_CONTACT_ADD, 0, 0);
::CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)this->m_szModuleName);
ptrW nick(::mir_utf8decodeW(contact->GetNick()));
- switch(availability)
- {
+ switch(availability) {
case CContact::SKYPEOUT:
this->setByte(hContact, "IsSkypeOut", 1);
break;
@@ -256,7 +255,7 @@ void __cdecl CSkypeProto::LoadContactList(void* data)
{
CContact::Ref contact = this->contactList[i];
- HANDLE hContact = this->AddContact(contact);
+ HCONTACT hContact = this->AddContact(contact);
if ( !isFirstLoad)
{
@@ -294,7 +293,7 @@ void __cdecl CSkypeProto::LoadAuthWaitList(void*)
}
}
-bool CSkypeProto::IsContactOnline(HANDLE hContact)
+bool CSkypeProto::IsContactOnline(HCONTACT hContact)
{
return this->getWord(hContact, SKYPE_SETTINGS_STATUS, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE;
}
@@ -303,7 +302,7 @@ void CSkypeProto::SetAllContactStatus(int status)
{
::EnterCriticalSection(&this->contact_search_lock);
- for (HANDLE hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName))
+ for (HCONTACT hContact = ::db_find_first(this->m_szModuleName); hContact; hContact = ::db_find_next(hContact, this->m_szModuleName))
{
if (this->getByte(hContact, "IsSkypeOut", 0) != 0)
continue;
@@ -356,7 +355,7 @@ void __cdecl CSkypeProto::SearchBySidAsync(void* arg)
{
mir_ptr<wchar_t> sid((wchar_t*)arg);
- HANDLE hContact = this->GetContactBySid(sid);
+ HCONTACT hContact = this->GetContactBySid(sid);
if (hContact)
{
this->ShowNotification(TranslateT("Contact already in your contact list"), 0, hContact);
@@ -463,7 +462,7 @@ void CSkypeProto::OnContactsReceived(const ConversationRef &conversation, const
CContact::Ref author;
this->GetContact(data, author);
- HANDLE hContact = this->AddContact(author);
+ HCONTACT hContact = this->AddContact(author);
SEBinary guid;
message->GetPropGuid(guid);
@@ -519,7 +518,7 @@ void CSkypeProto::OnContactsSent(const ConversationRef &conversation, const Mess
CContact::Ref receiver;
this->GetContact(data, receiver);
- HANDLE hContact = this->AddContact(receiver);
+ HCONTACT hContact = this->AddContact(receiver);
this->SendBroadcast(
hContact,
ACKTYPE_CONTACTS,