From 5e77e8a1665382c76fee1bc3ca12e44aca9af2e7 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 20 Dec 2012 17:25:21 +0000 Subject: - third approach of group chat support - added connection options - fixed connection via proxy git-svn-id: http://svn.miranda-ng.org/main/trunk@2772 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_contacts.cpp | 45 +++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'protocols/Skype/src/skype_contacts.cpp') diff --git a/protocols/Skype/src/skype_contacts.cpp b/protocols/Skype/src/skype_contacts.cpp index eae999ef92..116149cd55 100644 --- a/protocols/Skype/src/skype_contacts.cpp +++ b/protocols/Skype/src/skype_contacts.cpp @@ -531,16 +531,17 @@ bool CSkypeProto::IsProtoContact(HANDLE hContact) HANDLE CSkypeProto::GetContactBySid(const char *sid) { - HANDLE hContact = db_find_first(); + HANDLE hContact = ::db_find_first(); while (hContact) { if (this->IsProtoContact(hContact) && !this->IsChatRoom(hContact)) { - if (::strcmp(sid, ::DBGetString(hContact, this->m_szModuleName, "sid")) == 0) + char *contactSid = ::DBGetString(hContact, this->m_szModuleName, "sid"); + if (contactSid && ::strcmp(sid, contactSid) == 0) return hContact; } - hContact = db_find_next(hContact); + hContact = ::db_find_next(hContact); } return 0; @@ -721,6 +722,44 @@ void __cdecl CSkypeProto::LoadContactList(void*) this->UpdateContactStatusMessage(hContact, contact); } + CConversation::Refs conversations; + g_skype->GetConversationList(conversations); + for (uint i = 0; i < conversations.size(); i++) + { + CConversation::TYPE type; + conversations[i]->GetPropType(type); + + CConversation::MY_STATUS status; + conversations[i]->GetPropMyStatus(status); + if (type == CConversation::CONFERENCE) + { + SEString data; + + conversations[i]->GetPropIdentity(data); + char *cid = ::mir_strdup((const char *)data); + + conversations[i]->GetPropDisplayname(data); + char *name = ::mir_utf8decodeA((const char *)data); + + HANDLE hContact = this->AddChatRoomByID(cid, name); + + CConversation::LOCAL_LIVESTATUS live; + conversations[i]->GetPropLocalLivestatus(live); + + if (status == CConversation::CONSUMER)// && live != CConversation::NONE) + { + this->JoinToChat(cid, false); + } + } + } + + /*CConversation::Refs conversations; + g_skype->GetConversationList(conversations); + for (uint i = 0; i < conversations.size(); i++) + { + conversations[i]->Delete(); + }*/ + // raise auth event for all non auth contacts CContact::Refs authContacts; g_skype->GetHardwiredContactGroup(CContactGroup::CONTACTS_WAITING_MY_AUTHORIZATION, this->authWaitList); -- cgit v1.2.3