summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_proto.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-05-13 18:30:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-05-13 18:30:05 +0000
commit2a1e6f05aa9fcc4dfe642bd42aeb175e3958d4b3 (patch)
tree1f0195caf23d086ecae10fc75b11fa61d85e9a66 /protocols/Skype/src/skype_proto.cpp
parent59651e97603936fc7179864506caa1818e260c76 (diff)
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
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r--protocols/Skype/src/skype_proto.cpp16
1 files changed, 9 insertions, 7 deletions
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<char>(::mir_utf8encodeW(psr->id)), contact);
+ this->GetContact((char *)mir_ptr<char>(::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<char>(::mir_u2a( mir_ptr<wchar_t>(::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<char>(::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)
{