diff options
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 16 |
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)
{
|