summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_proto.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-09-28 05:35:12 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-09-28 05:35:12 +0000
commitb22b6804903e1e8e0e51fd8c78d928f0204672b5 (patch)
treef369ac01abb576c2b1cb1798a29de166b28b7894 /protocols/Skype/src/skype_proto.cpp
parentf67a19f8cae9d4532e908a75b9f921cfdc596f54 (diff)
- added some function to contacs loading
git-svn-id: http://svn.miranda-ng.org/main/trunk@1697 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r--protocols/Skype/src/skype_proto.cpp56
1 files changed, 55 insertions, 1 deletions
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp
index 498239053b..aa9af339ae 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -39,7 +39,14 @@ CSkypeProto::~CSkypeProto()
mir_free(this->m_tszUserName);
}
-HANDLE __cdecl CSkypeProto::AddToList( int flags, PROTOSEARCHRESULT* psr ) { return 0; }
+HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
+{
+ if (psr->cbSize != sizeof(PROTOSEARCHRESULT))
+ return 0;
+
+ return this->AddToListBySkypeLogin(psr->id, psr->nick, psr->firstName, psr->lastName, flags);
+}
+
HANDLE __cdecl CSkypeProto::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ) { return 0; }
int __cdecl CSkypeProto::Authorize( HANDLE hDbEvent ) { return 0; }
int __cdecl CSkypeProto::AuthDeny( HANDLE hDbEvent, const TCHAR* szReason ) { return 0; }
@@ -203,6 +210,53 @@ void __cdecl CSkypeProto::SignIn(void*)
this->account->LoginWithPassword(mir_u2a(this->password), false, false);
this->account->BlockWhileLoggingIn();
this->SetStatus(this->m_iDesiredStatus);
+ this->ForkThread(&CSkypeProto::LoadContactList, this);
ReleaseMutex(this->signin_lock);
+}
+
+void __cdecl CSkypeProto::LoadContactList(void*)
+{
+ CContactGroup::Ref contacts;
+ g_skype->GetHardwiredContactGroup(CContactGroup::ALL_KNOWN_CONTACTS, contacts);
+
+ contacts->GetContacts(contacts->ContactList);
+ fetch(contacts->ContactList);
+
+ for (unsigned int i = 0; i < contacts->ContactList.size(); i++)
+ {
+ SEString contactName;
+ contacts->ContactList[i]->GetPropDisplayname(contactName);
+ printf("%3d. %s\n", i+1, (const char*)contactName);
+
+ //HANDLE hContact = AddToContactList(fbu, FACEBOOK_CONTACT_APPROVE, false, fbu->real_name.c_str());
+ //DBWriteContactSettingByte(hContact, m_szModuleName, FACEBOOK_KEY_CONTACT_TYPE, FACEBOOK_CONTACT_APPROVE);
+ }
+}
+
+HANDLE CSkypeProto::AddToListBySkypeLogin(TCHAR* skypeName, TCHAR* nickName, TCHAR* firstName, TCHAR* lastName, DWORD flags)
+{
+ //if (!skypeName)
+ return NULL;
+
+ /*BOOL bAdded;
+ HANDLE hContact = MraHContactFromEmail( _T2A(plpsEMail), lstrlen(plpsEMail), TRUE, TRUE, &bAdded);
+ if (hContact) {
+ if (nickName)
+ mraSetStringW(hContact, "Nick", nickName);
+ if (firstName)
+ mraSetStringW(hContact, "FirstName", firstName);
+ if (lastName)
+ mraSetStringW(hContact, "LastName", lastName);
+
+ if (flags & PALF_TEMPORARY)
+ DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
+ else
+ DBDeleteContactSetting(hContact, "CList", "NotOnList");
+
+ if (bAdded)
+ MraUpdateContactInfo(hContact);
+ }
+
+ return hContact;*/
} \ No newline at end of file