From e52132834312c3d956323650f4fa34e94b95325e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 9 Jul 2013 15:47:48 +0000 Subject: forgotten to adapt wasuup git-svn-id: http://svn.miranda-ng.org/main/trunk@5298 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/contacts.cpp | 6 ++---- protocols/WhatsApp/src/messages.cpp | 4 ++-- protocols/WhatsApp/src/proto.cpp | 10 +++------- protocols/WhatsApp/src/proto.h | 8 ++++---- protocols/WhatsApp/src/theme.cpp | 5 ++--- 5 files changed, 13 insertions(+), 20 deletions(-) (limited to 'protocols/WhatsApp/src') diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index 1f942362dd..0e459f8d85 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -705,16 +705,14 @@ void __cdecl WhatsAppProto::SendCreateGroupWorker(void* data) } } -int __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam) +INT_PTR __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam) { DBVARIANT dbv; HANDLE hContact = reinterpret_cast(wParam); input_box* ib = new input_box; if (db_get_s(hContact, m_szModuleName, WHATSAPP_KEY_PUSH_NAME, &dbv, DBVT_WCHAR)) - { ib->defaultValue = _T(""); - } else { ib->defaultValue = dbv.ptszVal; @@ -735,7 +733,7 @@ int __cdecl WhatsAppProto::OnChangeGroupSubject(WPARAM wParam, LPARAM lParam) return 0; } -int __cdecl WhatsAppProto::OnLeaveGroup(WPARAM wParam, LPARAM) +INT_PTR __cdecl WhatsAppProto::OnLeaveGroup(WPARAM wParam, LPARAM) { DBVARIANT dbv; HANDLE hContact = reinterpret_cast(wParam); diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index d45d3ec2d9..4dd3b10997 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -45,7 +45,7 @@ int WhatsAppProto::SendMsg(HANDLE hContact, int flags, const char *msg) LOG(""); int msgId = ++(this->msgId); - ForkThread( &WhatsAppProto::SendMsgWorker, this, new send_direct(hContact, msg, (HANDLE) msgId, flags & IS_CHAT)); + ForkThread( &WhatsAppProto::SendMsgWorker, new send_direct(hContact, msg, (HANDLE) msgId, flags & IS_CHAT)); return this->msgIdHeader + msgId; } @@ -134,7 +134,7 @@ void WhatsAppProto::onIsTyping(const std::string& paramString, bool paramBoolean int WhatsAppProto::UserIsTyping(HANDLE hContact,int type) { if (hContact && isOnline()) - ForkThread(&WhatsAppProto::SendTypingWorker, this, new send_typing(hContact, type)); + ForkThread(&WhatsAppProto::SendTypingWorker, new send_typing(hContact, type)); return 0; } diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 1c8fab0515..bd74705bce 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -1,9 +1,8 @@ #include "common.h" -WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) +WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : + PROTO(proto_name, username) { - ProtoConstructor(this, proto_name, username); - this->challenge = new std::vector; this->msgId = 0; this->msgIdHeader = time(NULL); @@ -63,8 +62,6 @@ WhatsAppProto::~WhatsAppProto() if (this->challenge != NULL) delete this->challenge; - - ProtoDestructor(this); } DWORD_PTR WhatsAppProto::GetCaps( int type, HANDLE hContact ) @@ -161,8 +158,7 @@ HANDLE WhatsAppProto::SearchBasic( const PROTOCHAR* id ) return 0; TCHAR* email = mir_tstrdup(id); - ForkThread(&WhatsAppProto::SearchAckThread, this, (void*)email); - + ForkThread(&WhatsAppProto::SearchAckThread, email); return email; } diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 65430567fb..d8365501cc 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -3,10 +3,10 @@ class WASocketConnection; -class WhatsAppProto : public PROTO_INTERFACE, public WAListener, public WAGroupListener +class WhatsAppProto : public PROTO, public WAListener, public WAGroupListener { public: - WhatsAppProto( const char *proto_name, const TCHAR *username ); + WhatsAppProto(const char *proto_name, const TCHAR *username); ~WhatsAppProto( ); inline const char* ModuleName( ) const @@ -95,8 +95,8 @@ public: INT_PTR __cdecl OnAddContactToGroup(WPARAM, LPARAM, LPARAM); INT_PTR __cdecl OnRemoveContactFromGroup(WPARAM, LPARAM, LPARAM); - int __cdecl OnChangeGroupSubject(WPARAM, LPARAM); - int __cdecl OnLeaveGroup(WPARAM, LPARAM); + INT_PTR __cdecl OnChangeGroupSubject(WPARAM, LPARAM); + INT_PTR __cdecl OnLeaveGroup(WPARAM, LPARAM); // Loops bool NegotiateConnection(); diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index 4c6a578c0f..0e277544a4 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -53,7 +53,7 @@ static WhatsAppProto* GetInstanceByHContact(HANDLE hContact) return 0; } -template +template INT_PTR GlobalService(WPARAM wParam,LPARAM lParam) { WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast(wParam)); @@ -67,7 +67,6 @@ INT_PTR GlobalServiceParam(WPARAM wParam,LPARAM lParam, LPARAM lParam2) return proto ? (proto->*Fcn)(wParam,lParam,lParam2) : 0; } - static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam) { for (size_t i=0; i