From 2a1e6f05aa9fcc4dfe642bd42aeb175e3958d4b3 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Mon, 13 May 2013 18:30:05 +0000 Subject: Merged revision(s) from branches/unsane/skype_test: - CSkypeProto is derived of Skype class now - chat events moved to skype_chat.cpp - fixed chat message timestamp - fixed #331, #332 git-svn-id: http://svn.miranda-ng.org/main/trunk@4644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 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 db33037edc..6044bd6343 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -1,6 +1,6 @@ #include "skype_proto.h" -CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) +CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) : Skype(1) { ::ProtoConstructor(this, protoName, userName); @@ -37,13 +37,15 @@ CSkypeProto::~CSkypeProto() this->password = NULL; } + this->stop(); + ::ProtoDestructor(this); } HANDLE __cdecl CSkypeProto::AddToList(int flags, PROTOSEARCHRESULT* psr) { CContact::Ref contact; - g_skype->GetContact((char *)mir_ptr(::mir_utf8encodeW(psr->id)), contact); + this->GetContact((char *)mir_ptr(::mir_utf8encodeW(psr->id)), contact); return this->AddContact(contact); } @@ -124,7 +126,7 @@ int __cdecl CSkypeProto::AuthRequest(HANDLE hContact, const TCHAR* szMessage) { CContact::Ref contact; SEString sid( mir_ptr(::mir_u2a( mir_ptr(::db_get_wsa(hContact, this->m_szModuleName, SKYPE_SETTINGS_LOGIN))))); - if (g_skype->GetContact(sid, contact)) + if (this->GetContact(sid, contact)) { contact->SetBuddyStatus(Contact::AUTHORIZED_BY_ME); contact->SendAuthRequest(::mir_utf8encodeW(szMessage)); @@ -142,7 +144,7 @@ HANDLE __cdecl CSkypeProto::FileAllow( HANDLE hContact, HANDLE hTransfer, const { uint oid = (uint)hTransfer; - CMessage *message = new CMessage(oid, g_skype); + CMessage *message = this->newMessage(oid); this->Log(L"Incoming file transfer is accepted"); CTransfer::Refs transfers; @@ -319,7 +321,7 @@ HANDLE __cdecl CSkypeProto::SendFile(HANDLE hContact, const TCHAR *szDescription targets.append((char *)mir_ptr(::mir_utf8encodeW(sid))); CConversation::Ref conversation; - g_skype->GetConversationByParticipants(targets, conversation); + this->GetConversationByParticipants(targets, conversation); SEFilenameList fileList; for (int i = 0; ppszFiles[i]; i++) @@ -358,7 +360,7 @@ int __cdecl CSkypeProto::SendMsg(HANDLE hContact, int flags, const char *msg) targets.append(identity); CConversation::Ref conversation; - g_skype->GetConversationByParticipants(targets, conversation); + this->GetConversationByParticipants(targets, conversation); if (conversation) { @@ -443,7 +445,7 @@ int __cdecl CSkypeProto::UserIsTyping(HANDLE hContact, int type) targets.append(std::string(::mir_utf8encodeW(sid)).c_str()); CConversation::Ref conversation; - g_skype->GetConversationByParticipants(targets, conversation); + this->GetConversationByParticipants(targets, conversation); if (conversation) { -- cgit v1.2.3