From 4d52061bac77ed58941fc614736719bbb18620ba Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 6 Aug 2013 20:06:49 +0000 Subject: more cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@5606 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_chat.cpp | 4 ++++ protocols/Skype/src/skype_chat.h | 2 +- protocols/Skype/src/skype_proto.cpp | 6 +++++- protocols/Skype/src/skype_proto.h | 2 ++ protocols/WhatsApp/src/WASocketConnection.cpp | 4 ++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/protocols/Skype/src/skype_chat.cpp b/protocols/Skype/src/skype_chat.cpp index 56a26d011b..ee3626842e 100644 --- a/protocols/Skype/src/skype_chat.cpp +++ b/protocols/Skype/src/skype_chat.cpp @@ -336,6 +336,7 @@ void ChatRoom::Join(const wchar_t *joinBlob, CSkypeProto *ppro) CSkypeProto::ReplaceSpecialChars(cid); ChatRoom *room = new ChatRoom(cid, name, ppro); + ppro->chatRooms.insert(room); room->Start(conversation, true); } } @@ -1660,6 +1661,7 @@ void __cdecl CSkypeProto::LoadChatList(void*) ptrW name = ::mir_utf8decodeW(data); ChatRoom *room = new ChatRoom(cid, name, this); + chatRooms.insert(room); room->Start(conversation); } } @@ -1695,6 +1697,7 @@ void CSkypeProto::OnChatEvent(const ConversationRef &conversation, const Message ptrW name = ::mir_utf8decodeW(data); ChatRoom *room = new ChatRoom(cid, name, this); + chatRooms.insert(room); room->Start(conversation, true); } } @@ -1720,6 +1723,7 @@ void CSkypeProto::OnConversationListChange( ptrW name = ::mir_utf8decodeW(data); ChatRoom *room = new ChatRoom(cid, name, this); + chatRooms.insert(room); room->Start(conversation, true); } } diff --git a/protocols/Skype/src/skype_chat.h b/protocols/Skype/src/skype_chat.h index c639f2942f..3235622348 100644 --- a/protocols/Skype/src/skype_chat.h +++ b/protocols/Skype/src/skype_chat.h @@ -131,7 +131,7 @@ private: HANDLE hContact; - LIST members; + OBJLIST members; CSkypeProto *ppro; diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 7a64df8adf..b4890011ef 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -1,9 +1,11 @@ #include "skype.h" +#include "skype_chat.h" CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) : PROTO(protoName, userName), Skype(1), - skypeKitPort(8963) + skypeKitPort(8963), + chatRooms(5) { this->rememberPassword = false; @@ -42,6 +44,8 @@ CSkypeProto::~CSkypeProto() ::mir_free(this->password); this->password = NULL; } + + this->chatRooms.destroy(); } HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) diff --git a/protocols/Skype/src/skype_proto.h b/protocols/Skype/src/skype_proto.h index a391ecd0ed..432ca34dc7 100644 --- a/protocols/Skype/src/skype_proto.h +++ b/protocols/Skype/src/skype_proto.h @@ -349,6 +349,8 @@ protected: void OnChatEvent(const ConversationRef &conversation, const MessageRef &message); + OBJLIST chatRooms; + // contacts void UpdateContactAuthState(HANDLE hContact, const ContactRef &contact); void UpdateContactStatus(HANDLE hContact, const ContactRef &contact); diff --git a/protocols/WhatsApp/src/WASocketConnection.cpp b/protocols/WhatsApp/src/WASocketConnection.cpp index 15397f9932..477f463291 100644 --- a/protocols/WhatsApp/src/WASocketConnection.cpp +++ b/protocols/WhatsApp/src/WASocketConnection.cpp @@ -135,5 +135,5 @@ void WASocketConnection::forceShutdown() { WASocketConnection::~WASocketConnection() { this->forceShutdown(); - //SDLNet_TCP_Close(this->socket); -} \ No newline at end of file + Netlib_CloseHandle(this->hConn); +} -- cgit v1.2.3