From ca5001026a94f702c4012c5e8d2093ad3f51c1fa Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Apr 2018 12:33:31 +0300 Subject: code cleaning: - in conformance to C++'11 rules, we don't declare a method as virtual if it's declared as override; - cause this code isn't visible in Pascal anymore, there's no need to use __cdecl calling convention for virtual methods; - since PROTO_INTERFACE is a regular C++ class, there's no need to use old style service declarations for virtual methods like OnModulesLoaded / OnShutdown --- protocols/Tox/src/tox_proto.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'protocols/Tox/src/tox_proto.cpp') diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index f5a169797b..6e95610f26 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -43,7 +43,18 @@ CToxProto::~CToxProto() UninitNetlib(); } -DWORD_PTR CToxProto::GetCaps(int type, MCONTACT) +void CToxProto::OnModulesLoaded() +{ + Clist_GroupCreate(0, m_defaultGroup); + + HookProtoEvent(ME_OPT_INITIALISE, &CToxProto::OnOptionsInit); + HookProtoEvent(ME_USERINFO_INITIALISE, &CToxProto::OnUserInfoInit); + HookProtoEvent(ME_MSG_PRECREATEEVENT, &CToxProto::OnPreCreateMessage); + + InitCustomDbEvents(); +} + +INT_PTR CToxProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -216,9 +227,6 @@ int CToxProto::UserIsTyping(MCONTACT hContact, int type) int CToxProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) { switch (iEventType) { - case EV_PROTO_ONLOAD: - return OnAccountLoaded(wParam, lParam); - case EV_PROTO_ONRENAME: return OnAccountRenamed(wParam, lParam); -- cgit v1.2.3