summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-09 15:47:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-09 15:47:48 +0000
commite52132834312c3d956323650f4fa34e94b95325e (patch)
tree21fe856be6322cf844945c7dbde57c9fa0f25156 /protocols
parent6ea844fd51084c2e78fe400e1a9034c7960a922a (diff)
forgotten to adapt wasuup
git-svn-id: http://svn.miranda-ng.org/main/trunk@5298 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/contacts.cpp6
-rw-r--r--protocols/WhatsApp/src/messages.cpp4
-rw-r--r--protocols/WhatsApp/src/proto.cpp10
-rw-r--r--protocols/WhatsApp/src/proto.h8
-rw-r--r--protocols/WhatsApp/src/theme.cpp5
5 files changed, 13 insertions, 20 deletions
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<HANDLE>(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<HANDLE>(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<WhatsAppProto>(proto_name, username)
{
- ProtoConstructor(this, proto_name, username);
-
this->challenge = new std::vector<unsigned char>;
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<WhatsAppProto>, 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<int (__cdecl WhatsAppProto::*Fcn)(WPARAM,LPARAM)>
+template<INT_PTR (__cdecl WhatsAppProto::*Fcn)(WPARAM,LPARAM)>
INT_PTR GlobalService(WPARAM wParam,LPARAM lParam)
{
WhatsAppProto *proto = GetInstanceByHContact(reinterpret_cast<HANDLE>(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<SIZEOF(g_hContactMenuItems); i++)
@@ -79,7 +78,7 @@ static int PrebuildContactMenu(WPARAM wParam,LPARAM lParam)
void WhatsAppProto::InitContactMenus()
{
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
+ ::HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
CLISTMENUITEM mi = {sizeof(mi)};