summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-21 12:33:31 +0300
commitca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch)
tree554ad80633528d530057fc61035b15f901860ed2 /protocols/Discord/src/proto.cpp
parente0799755b3966d1d6d8275ee5127242ec029a4e6 (diff)
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
Diffstat (limited to 'protocols/Discord/src/proto.cpp')
-rw-r--r--protocols/Discord/src/proto.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp
index 8c0aaa1abd..003079a283 100644
--- a/protocols/Discord/src/proto.cpp
+++ b/protocols/Discord/src/proto.cpp
@@ -92,7 +92,7 @@ CDiscordProto::~CDiscordProto()
::CloseHandle(m_evRequestsQueue);
}
-DWORD_PTR CDiscordProto::GetCaps(int type, MCONTACT)
+INT_PTR CDiscordProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -104,7 +104,7 @@ DWORD_PTR CDiscordProto::GetCaps(int type, MCONTACT)
case PFLAGNUM_4:
return PF4_FORCEADDED | PF4_FORCEAUTH | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_SUPPORTIDLE | PF4_AVATARS | PF4_IMSENDOFFLINE;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("User ID");
+ return (INT_PTR)Translate("User ID");
}
return 0;
}
@@ -549,7 +549,7 @@ HANDLE CDiscordProto::SendFile(MCONTACT hContact, const wchar_t *szDescription,
/////////////////////////////////////////////////////////////////////////////////////////
-int CDiscordProto::OnModulesLoaded(WPARAM, LPARAM)
+void CDiscordProto::OnModulesLoaded()
{
// Fill users list
for (auto &hContact : AccContacts()) {
@@ -575,10 +575,9 @@ int CDiscordProto::OnModulesLoaded(WPARAM, LPARAM)
HookProtoEvent(ME_GC_BUILDMENU, &CDiscordProto::GroupchatMenuHook);
InitMenus();
- return 0;
}
-int CDiscordProto::OnPreShutdown(WPARAM, LPARAM)
+void CDiscordProto::OnShutdown()
{
debugLogA("CDiscordProto::OnPreShutdown");
@@ -587,20 +586,13 @@ int CDiscordProto::OnPreShutdown(WPARAM, LPARAM)
if (m_hGatewayConnection)
Netlib_Shutdown(m_hGatewayConnection);
- return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
-int CDiscordProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
+int CDiscordProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM)
{
switch (event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(wParam, lParam);
-
case EV_PROTO_ONCONTACTDELETED:
return OnDeleteContact((MCONTACT)wParam);
}