From 75fe175886ceca31d4cade1c067de7b0e1e30d87 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 30 Sep 2012 15:10:33 +0000 Subject: - conatcts funcs moved into skype_contacts.cpp - added settings functions Set* - first approach to load contact list - start skype runtime on startup git-svn-id: http://svn.miranda-ng.org/main/trunk@1731 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 52 ++++--------------------------------- 1 file changed, 5 insertions(+), 47 deletions(-) (limited to 'protocols/Skype/src/skype_proto.cpp') diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index aa9af339ae..962dce0167 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -11,6 +11,7 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) //this->m_szProtoName[0] = toupper(m_szProtoName[0]); this->signin_lock = CreateMutex(0, false, 0); + this->SetAllContactStatuses(ID_STATUS_OFFLINE); TCHAR name[128]; mir_sntprintf(name, SIZEOF(name), TranslateT("%s connection"), this->m_tszUserName); @@ -44,7 +45,7 @@ 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); + //return this->AddToListBySkypeLogin(psr->id, psr->nick, psr->firstName, psr->lastName, flags); } HANDLE __cdecl CSkypeProto::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent ) { return 0; } @@ -126,6 +127,7 @@ int CSkypeProto::SetStatus(int new_status) this->account->Logout(true); this->account->BlockWhileLoggingOut(); this->account->SetAvailability(CContact::OFFLINE); + this->SetAllContactStatuses(ID_STATUS_OFFLINE); } else { @@ -139,6 +141,7 @@ int CSkypeProto::SetStatus(int new_status) this->password = this->GetDecodeSettingString(SKYPE_SETTINGS_PASSWORD); this->ForkThread(&CSkypeProto::SignIn, this); + //this->SignIn(this); } } @@ -211,52 +214,7 @@ void __cdecl CSkypeProto::SignIn(void*) this->account->BlockWhileLoggingIn(); this->SetStatus(this->m_iDesiredStatus); this->ForkThread(&CSkypeProto::LoadContactList, this); + //this->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 -- cgit v1.2.3