diff options
author | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-04-21 12:33:31 +0300 |
commit | ca5001026a94f702c4012c5e8d2093ad3f51c1fa (patch) | |
tree | 554ad80633528d530057fc61035b15f901860ed2 /protocols | |
parent | e0799755b3966d1d6d8275ee5127242ec029a4e6 (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')
42 files changed, 543 insertions, 689 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); } diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index a33511d3bd..0b095d70da 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -258,28 +258,31 @@ public: ~CDiscordProto(); // PROTO_INTERFACE - virtual DWORD_PTR __cdecl GetCaps(int, MCONTACT = 0) override; + INT_PTR GetCaps(int, MCONTACT = 0) override; - virtual HWND __cdecl CreateExtendedSearchUI(HWND owner) override; - virtual HWND __cdecl SearchAdvanced(HWND owner) override; + HWND CreateExtendedSearchUI(HWND owner) override; + HWND SearchAdvanced(HWND owner) override; - virtual HANDLE __cdecl SearchBasic(const wchar_t* id) override; - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr) override; + HANDLE SearchBasic(const wchar_t* id) override; + MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override; - virtual int __cdecl AuthRecv(MCONTACT, PROTORECVEVENT* pre) override; - virtual int __cdecl Authorize(MEVENT hDbEvent) override; - virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override; - virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t*) override; + int AuthRecv(MCONTACT, PROTORECVEVENT* pre) override; + int Authorize(MEVENT hDbEvent) override; + int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override; + int AuthRequest(MCONTACT hContact, const wchar_t*) override; - virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) override; - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* pszSrc) override; + int RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) override; + int SendMsg(MCONTACT hContact, int flags, const char* pszSrc) override; - virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; + HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; - virtual int __cdecl UserIsTyping(MCONTACT hContact, int type) override; + int UserIsTyping(MCONTACT hContact, int type) override; - virtual int __cdecl SetStatus(int iNewStatus) override; - virtual int __cdecl OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM) override; + int SetStatus(int iNewStatus) override; + int OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM) override; + + void OnModulesLoaded() override; + void OnShutdown() override; // Services INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM); @@ -290,8 +293,6 @@ public: INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM); // Events - int __cdecl OnModulesLoaded(WPARAM, LPARAM); - int __cdecl OnPreShutdown(WPARAM, LPARAM); int __cdecl OnOptionsInit(WPARAM, LPARAM); int __cdecl OnDbEventRead(WPARAM, LPARAM); diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp index c68b687c18..9acb26d22d 100644 --- a/protocols/Dummy/src/dummy_proto.cpp +++ b/protocols/Dummy/src/dummy_proto.cpp @@ -87,7 +87,7 @@ int CDummyProto::getTemplateId() return id; } -DWORD_PTR CDummyProto::GetCaps(int type, MCONTACT) +INT_PTR CDummyProto::GetCaps(int type, MCONTACT) { switch(type) { case PFLAGNUM_1: @@ -115,7 +115,7 @@ DWORD_PTR CDummyProto::GetCaps(int type, MCONTACT) if (setting != NULL) strncpy_s(uniqueIdSetting, setting, _TRUNCATE); } - return (DWORD_PTR)uniqueIdSetting; + return (INT_PTR)uniqueIdSetting; } return 0; } diff --git a/protocols/Dummy/src/dummy_proto.h b/protocols/Dummy/src/dummy_proto.h index 3805467547..c49b17f2d0 100644 --- a/protocols/Dummy/src/dummy_proto.h +++ b/protocols/Dummy/src/dummy_proto.h @@ -28,21 +28,15 @@ struct CDummyProto : public PROTO<CDummyProto> // PROTO_INTERFACE //==================================================================================== - virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); + INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); + int SendMsg(MCONTACT hContact, int flags, const char* msg) override; - virtual int __cdecl SetStatus(int iNewStatus); + int SetStatus(int iNewStatus) override; - virtual HANDLE __cdecl SearchBasic(const wchar_t* id); + HANDLE SearchBasic(const wchar_t* id) override; - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - - //==== Events ======================================================================== - - int __cdecl OnModulesLoaded(WPARAM, LPARAM); - int __cdecl OnOptionsInit(WPARAM, LPARAM); - int __cdecl OnPreShutdown(WPARAM, LPARAM); + MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override; //==== Services ====================================================================== diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 64cea2b2e4..1e859eaba1 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -123,7 +123,7 @@ FacebookProto::~FacebookProto() ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT) +INT_PTR FacebookProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -149,7 +149,7 @@ DWORD_PTR FacebookProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE: return FACEBOOK_MESSAGE_LIMIT; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR) "Facebook ID"; + return (INT_PTR) "Facebook ID"; } return 0; } @@ -390,12 +390,6 @@ INT_PTR FacebookProto::GetNotificationsCount(WPARAM, LPARAM) int FacebookProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam) { switch (event) { - case EV_PROTO_ONLOAD: - return OnModulesLoaded(wParam, lParam); - - case EV_PROTO_ONEXIT: - return OnPreShutdown(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: return OnContactDeleted(wParam, lParam); @@ -416,7 +410,7 @@ INT_PTR FacebookProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, FBAccountProc, (LPARAM)this); } -int FacebookProto::OnModulesLoaded(WPARAM, LPARAM) +void FacebookProto::OnModulesLoaded() { HookProtoEvent(ME_MSG_WINDOWEVENT, &FacebookProto::OnProcessSrmmEvent); HookProtoEvent(ME_MSG_PRECREATEEVENT, &FacebookProto::OnPreCreateEvent); @@ -427,13 +421,11 @@ int FacebookProto::OnModulesLoaded(WPARAM, LPARAM) gcr.ptszDispName = m_tszUserName; gcr.iMaxText = FACEBOOK_MESSAGE_LIMIT; Chat_Register(&gcr); - return 0; } -int FacebookProto::OnPreShutdown(WPARAM, LPARAM) +void FacebookProto::OnShutdown() { SetStatus(ID_STATUS_OFFLINE); - return 0; } int FacebookProto::OnOptionsInit(WPARAM wParam, LPARAM) diff --git a/protocols/FacebookRM/src/proto.h b/protocols/FacebookRM/src/proto.h index 099d75a187..de18548415 100644 --- a/protocols/FacebookRM/src/proto.h +++ b/protocols/FacebookRM/src/proto.h @@ -100,32 +100,35 @@ public: __forceinline void setStringUtf(const char *name, const char* value) { db_set_utf(0, m_szModuleName, name, value); } __forceinline void setStringUtf(MCONTACT hContact, const char *name, const char* value) { db_set_utf(hContact, m_szModuleName, name, value); } - //PROTO_INTERFACE - - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - - virtual int __cdecl Authorize(MEVENT hDbEvent); - virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason); - virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage); - - virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = 0); - virtual int __cdecl GetInfo(MCONTACT hContact, int infoType); - - virtual HANDLE __cdecl SearchBasic(const wchar_t* id); - virtual HANDLE __cdecl SearchByEmail(const wchar_t* email); - virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName); - - virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*); - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); - - virtual int __cdecl SetStatus(int iNewStatus); - - virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); - virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg); - - virtual int __cdecl UserIsTyping(MCONTACT hContact, int type); - - virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); + //////////////////////////////////////////////////////////////////////////////////////// + // PROTO_INTERFACE + + MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override; + + int Authorize(MEVENT hDbEvent) override; + int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override; + int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override; + + INT_PTR GetCaps(int type, MCONTACT hContact = 0) override; + int GetInfo(MCONTACT hContact, int infoType) override; + + HANDLE SearchBasic(const wchar_t* id) override; + HANDLE SearchByEmail(const wchar_t* email) override; + HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override; + + int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override; + int SendMsg(MCONTACT hContact, int flags, const char* msg) override; + + int SetStatus(int iNewStatus) override; + + HANDLE GetAwayMsg(MCONTACT hContact) override; + int SetAwayMsg(int iStatus, const wchar_t* msg) override; + + int UserIsTyping(MCONTACT hContact, int type) override; + + int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override; + void OnModulesLoaded() override; + void OnShutdown() override; //////////////////////// @@ -164,12 +167,10 @@ public: void InitMenu(); // Events - int __cdecl OnModulesLoaded(WPARAM, LPARAM); int __cdecl OnOptionsInit(WPARAM, LPARAM); int __cdecl OnToolbarInit(WPARAM, LPARAM); int __cdecl OnBuildStatusMenu(WPARAM,LPARAM); int __cdecl OnContactDeleted(WPARAM,LPARAM); - int __cdecl OnPreShutdown(WPARAM,LPARAM); int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM); int __cdecl OnIdleChanged(WPARAM,LPARAM); int __cdecl OnGCEvent(WPARAM,LPARAM); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index d5f822ca0b..7072330d25 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -139,7 +139,7 @@ MCONTACT GaduProto::AddToList(int flags, PROTOSEARCHRESULT *pmsr) //////////////////////////////////////////////////////////
// checks proto capabilities
//
-DWORD_PTR GaduProto::GetCaps(int type, MCONTACT)
+INT_PTR GaduProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -155,7 +155,7 @@ DWORD_PTR GaduProto::GetCaps(int type, MCONTACT) case PFLAGNUM_5:
return PF2_LONGAWAY;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("Gadu-Gadu Number");
+ return (INT_PTR)Translate("Gadu-Gadu Number");
}
return 0;
}
@@ -699,36 +699,39 @@ int GaduProto::UserIsTyping(MCONTACT hContact, int type) //////////////////////////////////////////////////////////
// Custom protocol event
//
-int GaduProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+
+void GaduProto::OnModulesLoaded()
{
- switch (eventType) {
- case EV_PROTO_ONLOAD:
- HookProtoEvent(ME_OPT_INITIALISE, &GaduProto::options_init);
- HookProtoEvent(ME_USERINFO_INITIALISE, &GaduProto::details_init);
-
- // Init misc stuff
- gg_icolib_init();
- initpopups();
- gc_init();
- keepalive_init();
- img_init();
- block_init();
-
- // Try to fetch user avatar
- getOwnAvatar();
- break;
+ HookProtoEvent(ME_OPT_INITIALISE, &GaduProto::options_init);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &GaduProto::details_init);
+
+ // Init misc stuff
+ gg_icolib_init();
+ initpopups();
+ gc_init();
+ keepalive_init();
+ img_init();
+ block_init();
+
+ // Try to fetch user avatar
+ getOwnAvatar();
+}
- case EV_PROTO_ONEXIT:
- // Stop avatar request thread
- pth_avatar.dwThreadId = 0;
+void GaduProto::OnShutdown()
+{
+ // Stop avatar request thread
+ pth_avatar.dwThreadId = 0;
- // Stop main connection session thread
- pth_sess.dwThreadId = 0;
+ // Stop main connection session thread
+ pth_sess.dwThreadId = 0;
- img_shutdown();
- sessions_closedlg();
- break;
+ img_shutdown();
+ sessions_closedlg();
+}
+int GaduProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+{
+ switch (eventType) {
case EV_PROTO_ONMENU:
menus_init();
break;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h index 87555b9d06..dbec00c7ac 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.h +++ b/protocols/Gadu-Gadu/src/gg_proto.h @@ -31,32 +31,34 @@ struct GaduProto : public PROTO<GaduProto> // PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
-
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
-
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
-
- virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
-
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
-
- virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
- virtual int __cdecl SetStatus(int iNewStatus);
-
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t* msg);
-
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
-
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override;
+
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
+
+ HANDLE SearchBasic(const wchar_t* id) override;
+ HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override;
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
+
+ HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override;
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
+
+ int SetApparentMode(MCONTACT hContact, int mode) override;
+ int SetStatus(int iNewStatus) override;
+
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t* msg) override;
+
+ int UserIsTyping(MCONTACT hContact, int type) override;
+
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//////////////////////////////////////////////////////////////////////////////////////
// Services
diff --git a/protocols/Gadu-Gadu/src/libgadu/dcc.cpp b/protocols/Gadu-Gadu/src/libgadu/dcc.cpp index 3e65559964..2f3b901ab9 100644 --- a/protocols/Gadu-Gadu/src/libgadu/dcc.cpp +++ b/protocols/Gadu-Gadu/src/libgadu/dcc.cpp @@ -1329,8 +1329,6 @@ struct gg_event *gg_dcc_watch_fd(struct gg_dcc *h) return e;
}
}
-
- return e;
}
/**
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index aedd341e74..a5939a76a6 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -175,7 +175,7 @@ static int sttCheckPerform(const char *szSetting, void *lParam) return 0;
}
-int CIrcProto::OnModulesLoaded(WPARAM, LPARAM)
+void CIrcProto::OnModulesLoaded()
{
wchar_t name[128];
mir_snwprintf(name, TranslateT("%s server connection"), m_tszUserName);
@@ -274,14 +274,12 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) mir_wstrncpy(m_name, szBuf, 200);
}
}
-
- return 0;
}
////////////////////////////////////////////////////////////////////////////////////////
// AddToList - adds a contact to the contact list
-MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
+MCONTACT CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr)
{
if (m_iStatus == ID_STATUS_OFFLINE || m_iStatus == ID_STATUS_CONNECTING)
return 0;
@@ -322,7 +320,7 @@ MCONTACT __cdecl CIrcProto::AddToList(int, PROTOSEARCHRESULT* psr) ////////////////////////////////////////////////////////////////////////////////////////
// AuthAllow - processes the successful authorization
-int __cdecl CIrcProto::Authorize(MEVENT)
+int CIrcProto::Authorize(MEVENT)
{
return 0;
}
@@ -330,7 +328,7 @@ int __cdecl CIrcProto::Authorize(MEVENT) ////////////////////////////////////////////////////////////////////////////////////////
// AuthDeny - handles the unsuccessful authorization
-int __cdecl CIrcProto::AuthDeny(MEVENT, const wchar_t*)
+int CIrcProto::AuthDeny(MEVENT, const wchar_t*)
{
return 0;
}
@@ -338,7 +336,7 @@ int __cdecl CIrcProto::AuthDeny(MEVENT, const wchar_t*) ////////////////////////////////////////////////////////////////////////////////////////
// FileAllow - starts a file transfer
-HANDLE __cdecl CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
+HANDLE CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -359,7 +357,7 @@ HANDLE __cdecl CIrcProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* s ////////////////////////////////////////////////////////////////////////////////////////
// FileCancel - cancels a file transfer
-int __cdecl CIrcProto::FileCancel(MCONTACT, HANDLE hTransfer)
+int CIrcProto::FileCancel(MCONTACT, HANDLE hTransfer)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -375,7 +373,7 @@ int __cdecl CIrcProto::FileCancel(MCONTACT, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// FileDeny - denies a file transfer
-int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*)
+int CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*)
{
DCCINFO* di = (DCCINFO*)hTransfer;
delete di;
@@ -385,7 +383,7 @@ int __cdecl CIrcProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t*) ////////////////////////////////////////////////////////////////////////////////////////
// FileResume - processes file renaming etc
-int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
+int CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
DCCINFO* di = (DCCINFO*)hTransfer;
@@ -431,7 +429,7 @@ int __cdecl CIrcProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** ////////////////////////////////////////////////////////////////////////////////////////
// GetCaps - return protocol capabilities bits
-DWORD_PTR __cdecl CIrcProto::GetCaps(int type, MCONTACT)
+INT_PTR CIrcProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -447,7 +445,7 @@ DWORD_PTR __cdecl CIrcProto::GetCaps(int type, MCONTACT) return PF4_NOAUTHDENYREASON | PF4_NOCUSTOMAUTH;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("Nickname");
+ return (INT_PTR)Translate("Nickname");
case PFLAG_MAXLENOFMESSAGE:
return 400;
@@ -477,7 +475,7 @@ void __cdecl CIrcProto::AckBasicSearch(void *arg) delete param;
}
-HANDLE __cdecl CIrcProto::SearchBasic(const wchar_t* szId)
+HANDLE CIrcProto::SearchBasic(const wchar_t* szId)
{
if (szId) {
if (m_iStatus != ID_STATUS_OFFLINE && m_iStatus != ID_STATUS_CONNECTING &&
@@ -495,7 +493,7 @@ HANDLE __cdecl CIrcProto::SearchBasic(const wchar_t* szId) ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFiles)
+HANDLE CIrcProto::SendFile(MCONTACT hContact, const wchar_t*, wchar_t** ppszFiles)
{
DCCINFO* dci = nullptr;
int iPort = 0;
@@ -664,7 +662,7 @@ void __cdecl CIrcProto::AckMessageSuccess(void *info) delete param;
}
-int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
+int CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
{
BYTE bDcc = getByte(hContact, "DCC", 0);
WORD wStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
@@ -691,7 +689,7 @@ int __cdecl CIrcProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) ////////////////////////////////////////////////////////////////////////////////////////
// SetStatus - sets the protocol status
-int __cdecl CIrcProto::SetStatus(int iNewStatus)
+int CIrcProto::SetStatus(int iNewStatus)
{
return SetStatusInternal(iNewStatus, false);
}
@@ -758,7 +756,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal) ////////////////////////////////////////////////////////////////////////////////////////
// GetAwayMsg - returns a contact's away message
-HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact)
+HANDLE CIrcProto::GetAwayMsg(MCONTACT hContact)
{
WhoisAwayReply = L"";
DBVARIANT dbv;
@@ -785,7 +783,7 @@ HANDLE __cdecl CIrcProto::GetAwayMsg(MCONTACT hContact) ////////////////////////////////////////////////////////////////////////////////////////
// SetAwayMsg - sets the away status message
-int __cdecl CIrcProto::SetAwayMsg(int status, const wchar_t* msg)
+int CIrcProto::SetAwayMsg(int status, const wchar_t* msg)
{
switch (status) {
case ID_STATUS_ONLINE: case ID_STATUS_INVISIBLE: case ID_STATUS_FREECHAT:
@@ -812,12 +810,9 @@ int __cdecl CIrcProto::SetAwayMsg(int status, const wchar_t* msg) /////////////////////////////////////////////////////////////////////////////////////////
// OnEvent - maintain protocol events
-int __cdecl CIrcProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+int CIrcProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
switch (eventType) {
- case EV_PROTO_ONLOAD: return OnModulesLoaded(0, 0);
- case EV_PROTO_ONEXIT: return OnPreShutdown(0, 0);
-
case EV_PROTO_ONMENU:
InitMainMenus();
break;
diff --git a/protocols/IRCG/src/ircproto.h b/protocols/IRCG/src/ircproto.h index 4a3e27fd43..6948098cd2 100644 --- a/protocols/IRCG/src/ircproto.h +++ b/protocols/IRCG/src/ircproto.h @@ -47,30 +47,31 @@ struct CIrcProto : public PROTO<CIrcProto> ~CIrcProto(); // Protocol interface - - virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr); - - virtual int __cdecl Authorize(MEVENT hDbEvent); - virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason); - - virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath); - virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer); - virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason); - virtual int __cdecl FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename); - - virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); - - virtual HANDLE __cdecl SearchBasic(const wchar_t* id); - - virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles); - virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg); - - virtual int __cdecl SetStatus(int iNewStatus); - - virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact); - virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg); - - virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam); + MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override; + + int Authorize(MEVENT hDbEvent) override; + int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override; + + HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override; + int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; + int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason) override; + int FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename) override; + + INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; + + HANDLE SearchBasic(const wchar_t* id) override; + + HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; + int SendMsg(MCONTACT hContact, int flags, const char* msg) override; + + int SetStatus(int iNewStatus) override; + + HANDLE GetAwayMsg(MCONTACT hContact) override; + int SetAwayMsg(int m_iStatus, const wchar_t *msg) override; + + int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override; + void OnModulesLoaded() override; + void OnShutdown() override; // Services INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM); @@ -93,9 +94,7 @@ struct CIrcProto : public PROTO<CIrcProto> int __cdecl OnContactDeleted(WPARAM, LPARAM); int __cdecl OnInitOptionsPages(WPARAM, LPARAM); int __cdecl OnInitUserInfo(WPARAM, LPARAM); - int __cdecl OnModulesLoaded(WPARAM, LPARAM); int __cdecl OnMenuPreBuild(WPARAM, LPARAM); - int __cdecl OnPreShutdown(WPARAM, LPARAM); int __cdecl OnDbSettingChanged(WPARAM, LPARAM); int __cdecl GCEventHook(WPARAM, LPARAM); diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index b6775b8b05..0c798257f9 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -839,7 +839,7 @@ int __cdecl CIrcProto::GCMenuHook(WPARAM, LPARAM lParam) return 0;
}
-int __cdecl CIrcProto::OnPreShutdown(WPARAM, LPARAM)
+void CIrcProto::OnShutdown()
{
mir_cslock lock(cs);
@@ -857,7 +857,6 @@ int __cdecl CIrcProto::OnPreShutdown(WPARAM, LPARAM) m_nickDlg->Close();
if (m_joinDlg)
m_joinDlg->Close();
- return 0;
}
int __cdecl CIrcProto::OnMenuPreBuild(WPARAM hContact, LPARAM)
diff --git a/protocols/IcqOscarJ/src/icq_packet.cpp b/protocols/IcqOscarJ/src/icq_packet.cpp index 22aac5fd62..313562af13 100644 --- a/protocols/IcqOscarJ/src/icq_packet.cpp +++ b/protocols/IcqOscarJ/src/icq_packet.cpp @@ -443,8 +443,8 @@ void packLETLVLNTS(PBYTE *buf, size_t *bufpos, const char *str, WORD wType) size_t len = mir_strlen(str) + 1;
*(PWORD)(*buf + *bufpos) = wType;
- *(PWORD)(*buf + *bufpos + 2) = DWORD(len + 2);
- *(PWORD)(*buf + *bufpos + 4) = DWORD(len);
+ *(PWORD)(*buf + *bufpos + 2) = WORD(len + 2);
+ *(PWORD)(*buf + *bufpos + 4) = WORD(len);
memcpy(*buf + *bufpos + 6, str, len);
*bufpos += len + 6;
}
@@ -469,9 +469,9 @@ void ppackLETLVWordLNTS(PBYTE *buf, size_t *buflen, WORD w, const char *str, WOR *buf = (PBYTE)SAFE_REALLOC(*buf, 8 + *buflen + len);
*(PWORD)(*buf + *buflen) = wType;
- *(PWORD)(*buf + *buflen + 2) = DWORD(len + 4);
+ *(PWORD)(*buf + *buflen + 2) = WORD(len + 4);
*(PWORD)(*buf + *buflen + 4) = w;
- *(PWORD)(*buf + *buflen + 6) = DWORD(len);
+ *(PWORD)(*buf + *buflen + 6) = WORD(len);
memcpy(*buf + *buflen + 8, str, len);
*buflen += len + 8;
}
@@ -483,8 +483,8 @@ void ppackLETLVLNTSByte(PBYTE *buf, size_t *buflen, const char *str, BYTE b, WOR *buf = (PBYTE)SAFE_REALLOC(*buf, 7 + *buflen + len);
*(PWORD)(*buf + *buflen) = wType;
- *(PWORD)(*buf + *buflen + 2) = DWORD(len + 3);
- *(PWORD)(*buf + *buflen + 4) = DWORD(len);
+ *(PWORD)(*buf + *buflen + 2) = WORD(len + 3);
+ *(PWORD)(*buf + *buflen + 4) = WORD(len);
memcpy(*buf + *buflen + 6, str, len);
*(*buf + *buflen + 6 + len) = b;
*buflen += len + 7;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index e10146939f..768b81881b 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -232,7 +232,7 @@ CIcqProto::~CIcqProto() ////////////////////////////////////////////////////////////////////////////////////////
// OnModulesLoadedEx - performs hook registration
-int CIcqProto::OnModulesLoaded(WPARAM, LPARAM)
+void CIcqProto::OnModulesLoaded()
{
char pszP2PName[MAX_PATH];
char pszGroupsName[MAX_PATH];
@@ -264,17 +264,15 @@ int CIcqProto::OnModulesLoaded(WPARAM, LPARAM) if (bXStatus > 0)
setContactExtraIcon(hContact, bXStatus);
}
- return 0;
}
-int CIcqProto::OnPreShutdown(WPARAM, LPARAM)
+void CIcqProto::OnShutdown()
{
// signal info update thread to stop
icq_InfoUpdateCleanup();
// Make sure all connections are closed
CloseContactDirectConns(NULL);
- return 0;
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -311,7 +309,7 @@ MCONTACT CIcqProto::AddToList(int flags, PROTOSEARCHRESULT *psr) return AddToListByUID(szUid, flags);
}
-MCONTACT __cdecl CIcqProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
+MCONTACT CIcqProto::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent)
{
DWORD uin = 0;
uid_str uid = { 0 };
@@ -427,7 +425,7 @@ int CIcqProto::AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AUTH
-int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre)
+int CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre)
{
setContactHidden(hContact, 0);
ICQAddRecvEvent(NULL, EVENTTYPE_AUTHREQUEST, pre, pre->lParam, (PBYTE)pre->szMessage, 0);
@@ -437,7 +435,7 @@ int __cdecl CIcqProto::AuthRecv(MCONTACT hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// PSS_AUTHREQUEST
-int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
+int CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
{
if (!icqOnline())
return 1;
@@ -463,7 +461,7 @@ int __cdecl CIcqProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage) ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileAllow - starts a file transfer
-HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
+HANDLE CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath)
{
DWORD dwUin;
uid_str szUid;
@@ -504,7 +502,7 @@ HANDLE __cdecl CIcqProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const w ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileCancel - cancels a file transfer
-int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
+int CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer)
{
DWORD dwUin;
uid_str szUid;
@@ -533,7 +531,7 @@ int __cdecl CIcqProto::FileCancel(MCONTACT hContact, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileDeny - denies a file transfer
-int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
+int CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason)
{
int nReturnValue = 1;
basic_filetransfer *bft = (basic_filetransfer*)hTransfer;
@@ -573,7 +571,7 @@ int __cdecl CIcqProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar ////////////////////////////////////////////////////////////////////////////////////////
// PS_FileResume - processes file renaming etc
-int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
+int CIcqProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
if (icqOnline() && hTransfer) {
basic_filetransfer *ft = (basic_filetransfer *)hTransfer;
@@ -602,9 +600,9 @@ int __cdecl CIcqProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** ////////////////////////////////////////////////////////////////////////////////////////
// GetCaps - return protocol capabilities bits
-DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact)
+INT_PTR CIcqProto::GetCaps(int type, MCONTACT hContact)
{
- DWORD_PTR nReturn = 0;
+ INT_PTR nReturn = 0;
switch (type) {
@@ -636,7 +634,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact) return PF2_FREECHAT | PF2_ONTHEPHONE;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("User ID");
+ return (INT_PTR)Translate("User ID");
case PFLAG_MAXLENOFMESSAGE:
return MAX_MESSAGESNACSIZE - 102;
@@ -666,7 +664,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps(int type, MCONTACT hContact) ////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CIcqProto::GetInfo(MCONTACT hContact, int infoType)
+int CIcqProto::GetInfo(MCONTACT hContact, int infoType)
{
if (icqOnline()) {
DWORD dwUin;
@@ -712,7 +710,7 @@ void CIcqProto::CheekySearchThread(void*) }
-HANDLE __cdecl CIcqProto::SearchBasic(const wchar_t *pszSearch)
+HANDLE CIcqProto::SearchBasic(const wchar_t *pszSearch)
{
if (mir_wstrlen(pszSearch) == 0)
return nullptr;
@@ -760,7 +758,7 @@ HANDLE __cdecl CIcqProto::SearchBasic(const wchar_t *pszSearch) ////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CIcqProto::SearchByEmail(const wchar_t *email)
+HANDLE CIcqProto::SearchByEmail(const wchar_t *email)
{
if (email && icqOnline() && mir_wstrlen(email) > 0) {
char *szEmail = unicode_to_ansi(email);
@@ -783,7 +781,7 @@ HANDLE __cdecl CIcqProto::SearchByEmail(const wchar_t *email) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SearchByName - searches the contact by its first or last name, or by a nickname
-HANDLE __cdecl CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
+HANDLE CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
if (icqOnline()) {
if (nick || firstName || lastName) {
@@ -806,7 +804,7 @@ HANDLE __cdecl CIcqProto::SearchByName(const wchar_t *nick, const wchar_t *first }
-HWND __cdecl CIcqProto::CreateExtendedSearchUI(HWND parent)
+HWND CIcqProto::CreateExtendedSearchUI(HWND parent)
{
if (parent && g_plugin.getInst())
return CreateDialog(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ICQADVANCEDSEARCH), parent, AdvancedSearchDlgProc);
@@ -814,7 +812,7 @@ HWND __cdecl CIcqProto::CreateExtendedSearchUI(HWND parent) return nullptr; // Failure
}
-HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg)
+HWND CIcqProto::SearchAdvanced(HWND hwndDlg)
{
if (icqOnline() && IsWindow(hwndDlg)) {
size_t nDataLen;
@@ -834,7 +832,7 @@ HWND __cdecl CIcqProto::SearchAdvanced(HWND hwndDlg) ////////////////////////////////////////////////////////////////////////////////////////
// RecvContacts
-int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
+int CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
{
ICQSEARCHRESULT **isrList = (ICQSEARCHRESULT**)pre->szMessage;
int i;
@@ -871,7 +869,7 @@ int __cdecl CIcqProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
+int CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
{
size_t cbBlob = mir_strlen(pre->szMessage) + 1;
ICQAddRecvEvent(hContact, EVENTTYPE_MESSAGE, pre, cbBlob, (PBYTE)pre->szMessage, DBEF_UTF);
@@ -887,7 +885,7 @@ int __cdecl CIcqProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre) ////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
+int CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
{
if (hContact && hContactsList) {
DWORD dwUin;
@@ -1126,7 +1124,7 @@ int __cdecl CIcqProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
+HANDLE CIcqProto::SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles)
{
if (!icqOnline())
return nullptr;
@@ -1222,7 +1220,7 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const wchar_t* szDescripti ////////////////////////////////////////////////////////////////////////////////////////
// PS_SendMessage - sends a message
-int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
+int CIcqProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
{
if (hContact == NULL || pszSrc == nullptr)
return NULL;
@@ -1341,7 +1339,7 @@ int __cdecl CIcqProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) ////////////////////////////////////////////////////////////////////////////////////////
// SendUrl
-int __cdecl CIcqProto::SendUrl(MCONTACT hContact, int, const char* url)
+int CIcqProto::SendUrl(MCONTACT hContact, int, const char* url)
{
if (hContact == NULL || url == nullptr)
return 0;
@@ -1406,7 +1404,7 @@ int __cdecl CIcqProto::SendUrl(MCONTACT hContact, int, const char* url) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SetApparentMode - sets the visibility status
-int __cdecl CIcqProto::SetApparentMode(MCONTACT hContact, int mode)
+int CIcqProto::SetApparentMode(MCONTACT hContact, int mode)
{
DWORD uin;
uid_str uid;
@@ -1481,7 +1479,7 @@ char* CIcqProto::PrepareStatusNote(int nStatus) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SetStatus - sets the protocol status
-int __cdecl CIcqProto::SetStatus(int iNewStatus)
+int CIcqProto::SetStatus(int iNewStatus)
{
int nNewStatus = MirandaStatusToSupported(iNewStatus);
@@ -1621,7 +1619,7 @@ void __cdecl CIcqProto::GetAwayMsgThread(void *pStatusData) ////////////////////////////////////////////////////////////////////////////////////////
// PS_GetAwayMsg - returns a contact's away message
-HANDLE __cdecl CIcqProto::GetAwayMsg(MCONTACT hContact)
+HANDLE CIcqProto::GetAwayMsg(MCONTACT hContact)
{
DWORD dwUin;
uid_str szUID;
@@ -1704,7 +1702,7 @@ HANDLE __cdecl CIcqProto::GetAwayMsg(MCONTACT hContact) ////////////////////////////////////////////////////////////////////////////////////////
// PSR_AWAYMSG - processes received status mode message
-int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt)
+int CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt)
{
setStatusMsgVar(hContact, evt->szMessage, false);
@@ -1718,7 +1716,7 @@ int __cdecl CIcqProto::RecvAwayMsg(MCONTACT hContact, int, PROTORECVEVENT* evt) ////////////////////////////////////////////////////////////////////////////////////////
// PS_SetAwayMsg - sets the away status message
-int __cdecl CIcqProto::SetAwayMsg(int status, const wchar_t* msg)
+int CIcqProto::SetAwayMsg(int status, const wchar_t* msg)
{
mir_cslock l(m_modeMsgsMutex);
@@ -1787,7 +1785,7 @@ INT_PTR CIcqProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////
// PS_UserIsTyping - sends a UTN notification
-int __cdecl CIcqProto::UserIsTyping(MCONTACT hContact, int type)
+int CIcqProto::UserIsTyping(MCONTACT hContact, int type)
{
if (hContact && icqOnline()) {
if (CheckContactCapabilities(hContact, CAPF_TYPING)) {
@@ -1810,25 +1808,17 @@ int __cdecl CIcqProto::UserIsTyping(MCONTACT hContact, int type) /////////////////////////////////////////////////////////////////////////////////////////
// OnEvent - maintain protocol events
-int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+int CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
switch (eventType) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(0, 0);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(0, 0);
-
case EV_PROTO_ONERASE:
- {
- char szDbSetting[MAX_PATH];
- mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
- db_delete_module(0, szDbSetting);
- mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
- db_delete_module(0, szDbSetting);
- mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
- db_delete_module(0, szDbSetting);
- }
+ char szDbSetting[MAX_PATH];
+ mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
+ db_delete_module(0, szDbSetting);
+ mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
+ db_delete_module(0, szDbSetting);
+ mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
+ db_delete_module(0, szDbSetting);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h index 0adec2a619..4f4ff59415 100644 --- a/protocols/IcqOscarJ/src/icq_proto.h +++ b/protocols/IcqOscarJ/src/icq_proto.h @@ -54,46 +54,48 @@ struct CIcqProto : public PROTO<CIcqProto> // PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList( int flags, PROTOSEARCHRESULT *psr);
- virtual MCONTACT __cdecl AddToListByEvent( int flags, int iContact, MEVENT hDbEvent);
+ MCONTACT AddToList( int flags, PROTOSEARCHRESULT *psr) override;
+ MCONTACT AddToListByEvent( int flags, int iContact, MEVENT hDbEvent) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
- virtual int __cdecl FileResume( HANDLE hTransfer, int *action, const wchar_t **szFilename);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason) override;
+ int FileResume( HANDLE hTransfer, int *action, const wchar_t **szFilename) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByEmail(const wchar_t *email) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
- virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
+ int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
+ int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
- virtual int __cdecl SendUrl(MCONTACT hContact, int flags, const char *url);
+ int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
+ int SendUrl(MCONTACT hContact, int flags, const char *url) override;
- virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetApparentMode(MCONTACT hContact, int mode) override;
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT *evt) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t *msg) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//====| Services |====================================================================
INT_PTR __cdecl AddServerContact(WPARAM wParam, LPARAM lParam);
@@ -123,9 +125,7 @@ struct CIcqProto : public PROTO<CIcqProto> //====| Events |======================================================================
int __cdecl OnIdleChanged(WPARAM, LPARAM);
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
- int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnPreBuildContactMenu(WPARAM, LPARAM);
int __cdecl OnUserInfoInit(WPARAM, LPARAM);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 55519f1627..ea2a7ab003 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -261,7 +261,7 @@ CJabberProto::~CJabberProto() ////////////////////////////////////////////////////////////////////////////////////////
// OnModulesLoadedEx - performs hook registration
-int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
+void CJabberProto::OnModulesLoaded()
{
HookProtoEvent(ME_USERINFO_INITIALISE, &CJabberProto::OnUserInfoInit);
XStatusInit();
@@ -321,14 +321,12 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) m_lstTransports.insert(mir_wstrdup(jid));
}
}
-
- return 0;
}
///////////////////////////////////////////////////////////////////////////////
// OnPreShutdown - prepares Miranda to be shut down
-int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM)
+void CJabberProto::OnShutdown()
{
m_bShutdown = true;
@@ -355,7 +353,6 @@ int __cdecl CJabberProto::OnPreShutdown(WPARAM, LPARAM) ConsoleUninit();
Srmm_RemoveIcon(m_szModuleName, 0);
- return 0;
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -380,7 +377,7 @@ MCONTACT CJabberProto::AddToList(int flags, PROTOSEARCHRESULT* psr) return AddToListByJID(psr->id.w, flags);
}
-MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbEvent)
+MCONTACT CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbEvent)
{
debugLogA("AddToListByEvent");
@@ -486,7 +483,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileAllow - starts a file transfer
-HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wchar_t *szPath)
+HANDLE CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, const wchar_t *szPath)
{
if (!m_bJabberOnline)
return nullptr;
@@ -514,7 +511,7 @@ HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileCancel - cancels a file transfer
-int __cdecl CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer)
+int CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer)
{
filetransfer *ft = (filetransfer*)hTransfer;
HANDLE hEvent;
@@ -542,7 +539,7 @@ int __cdecl CJabberProto::FileCancel(MCONTACT, HANDLE hTransfer) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileDeny - denies a file transfer
-int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *)
+int CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *)
{
if (!m_bJabberOnline)
return 1;
@@ -570,7 +567,7 @@ int __cdecl CJabberProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t *) ////////////////////////////////////////////////////////////////////////////////////////
// JabberFileResume - processes file renaming etc
-int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
+int CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_t **szFilename)
{
filetransfer *ft = (filetransfer*)hTransfer;
if (!m_bJabberOnline || ft == nullptr)
@@ -586,7 +583,7 @@ int __cdecl CJabberProto::FileResume(HANDLE hTransfer, int *action, const wchar_ ////////////////////////////////////////////////////////////////////////////////////////
// GetCaps - return protocol capabilities bits
-DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact)
+INT_PTR CJabberProto::GetCaps(int type, MCONTACT hContact)
{
switch (type) {
case PFLAGNUM_1:
@@ -598,7 +595,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact) case PFLAGNUM_4:
return PF4_FORCEAUTH | PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_FORCEADDED;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("JID");
+ return (INT_PTR)Translate("JID");
case PFLAG_MAXCONTACTSPERPACKET:
wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
@@ -612,7 +609,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, MCONTACT hContact) ////////////////////////////////////////////////////////////////////////////////////////
// GetInfo - retrieves a contact info
-int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
+int CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/)
{
if (!m_bJabberOnline || isChatRoom(hContact))
return 1;
@@ -706,7 +703,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb) mir_free(jsb);
}
-HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid)
+HANDLE CJabberProto::SearchBasic(const wchar_t *szJid)
{
debugLogW(L"JabberBasicSearch called with lParam = '%s'", szJid);
@@ -746,7 +743,7 @@ HANDLE __cdecl CJabberProto::SearchBasic(const wchar_t *szJid) ////////////////////////////////////////////////////////////////////////////////////////
// SearchByEmail - searches the contact by its e-mail
-HANDLE __cdecl CJabberProto::SearchByEmail(const wchar_t *email)
+HANDLE CJabberProto::SearchByEmail(const wchar_t *email)
{
if (!m_bJabberOnline || email == nullptr)
return nullptr;
@@ -762,7 +759,7 @@ HANDLE __cdecl CJabberProto::SearchByEmail(const wchar_t *email) ////////////////////////////////////////////////////////////////////////////////////////
// JabberSearchByName - searches the contact by its first or last name, or by a nickname
-HANDLE __cdecl CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
+HANDLE CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName)
{
if (!m_bJabberOnline)
return nullptr;
@@ -809,7 +806,7 @@ HANDLE __cdecl CJabberProto::SearchByName(const wchar_t *nick, const wchar_t *fi ////////////////////////////////////////////////////////////////////////////////////////
// RecvMsg
-int __cdecl CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt)
+int CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt)
{
T2Utf szResUtf((const wchar_t *)evt->lParam);
evt->pCustomData = (char*)szResUtf;
@@ -820,7 +817,7 @@ int __cdecl CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) ////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
+int CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
{
if (!m_bJabberOnline)
return 0;
@@ -850,7 +847,7 @@ int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MC ////////////////////////////////////////////////////////////////////////////////////////
// SendFile - sends a file
-HANDLE __cdecl CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t** ppszFiles)
+HANDLE CJabberProto::SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t** ppszFiles)
{
if (!m_bJabberOnline) return nullptr;
@@ -961,7 +958,7 @@ void __cdecl CJabberProto::SendMessageAckThread(void* param) static char PGP_PROLOG[] = "-----BEGIN PGP MESSAGE-----\r\n\r\n";
static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n";
-int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char* pszSrc)
+int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char* pszSrc)
{
wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
@@ -1080,7 +1077,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const c ////////////////////////////////////////////////////////////////////////////////////////
// JabberSetApparentMode - sets the visibility status
-int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
+int CJabberProto::SetApparentMode(MCONTACT hContact, int mode)
{
if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE)
return 1;
@@ -1121,7 +1118,7 @@ int __cdecl CJabberProto::SetApparentMode(MCONTACT hContact, int mode) ////////////////////////////////////////////////////////////////////////////////////////
// JabberSetStatus - sets the protocol status
-int __cdecl CJabberProto::SetStatus(int iNewStatus)
+int CJabberProto::SetStatus(int iNewStatus)
{
if (m_iDesiredStatus == iNewStatus)
return 0;
@@ -1193,7 +1190,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
-HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact)
+HANDLE CJabberProto::GetAwayMsg(MCONTACT hContact)
{
ForkThread(&CJabberProto::GetAwayMsgThread, (void*)hContact);
return (HANDLE)1;
@@ -1202,7 +1199,7 @@ HANDLE __cdecl CJabberProto::GetAwayMsg(MCONTACT hContact) ////////////////////////////////////////////////////////////////////////////////////////
// JabberSetAwayMsg - sets the away status message
-int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg)
+int CJabberProto::SetAwayMsg(int status, const wchar_t *msg)
{
wchar_t **szMsg;
mir_cslockfull lck(m_csModeMsgMutex);
@@ -1253,7 +1250,7 @@ int __cdecl CJabberProto::SetAwayMsg(int status, const wchar_t *msg) /////////////////////////////////////////////////////////////////////////////////////////
// JabberUserIsTyping - sends a UTN notification
-int __cdecl CJabberProto::UserIsTyping(MCONTACT hContact, int type)
+int CJabberProto::UserIsTyping(MCONTACT hContact, int type)
{
if (!m_bJabberOnline) return 0;
@@ -1326,12 +1323,9 @@ void CJabberProto::InfoFrame_OnTransport(CJabberInfoFrame_Event *evt) /////////////////////////////////////////////////////////////////////////////////////////
// OnEvent - maintain protocol events
-int __cdecl CJabberProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+int CJabberProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
switch (eventType) {
- case EV_PROTO_ONLOAD: return OnModulesLoadedEx(0, 0);
- case EV_PROTO_ONEXIT: return OnPreShutdown(0, 0);
-
case EV_PROTO_ONMENU:
MenuInit();
break;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index e3c8aea5f1..4f08e9219a 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -76,41 +76,43 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface // PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t *szReason) override;
+ int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = 0);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
+ INT_PTR GetCaps(int type, MCONTACT hContact = 0) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByEmail(const wchar_t *email) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
- virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
+ int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
+ int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
- virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetApparentMode(MCONTACT hContact, int mode) override;
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t *msg) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//====| Services |====================================================================
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
@@ -122,9 +124,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface int __cdecl OnDbSettingChanged(WPARAM, LPARAM);
int __cdecl OnIdleChanged(WPARAM, LPARAM);
int __cdecl OnLangChanged(WPARAM, LPARAM);
- int __cdecl OnModulesLoadedEx(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
- int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnPrebuildContactMenu(WPARAM, LPARAM);
int __cdecl OnProcessSrmmIconClick(WPARAM, LPARAM);
int __cdecl OnProcessSrmmEvent(WPARAM, LPARAM);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 85037d7630..30b650883c 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -705,7 +705,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR return FALSE; } -HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) +HWND CJabberProto::CreateExtendedSearchUI(HWND parent) { if (parent && g_plugin.getInst()) { ptrW szServer(getWStringA("LoginServer")); @@ -719,7 +719,7 @@ HWND __cdecl CJabberProto::CreateExtendedSearchUI(HWND parent) ////////////////////////////////////////////////////////////////////////// // The function formats request to server -HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg) +HWND CJabberProto::SearchAdvanced(HWND hwndDlg) { if (!m_bJabberOnline || !hwndDlg) return nullptr; //error diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 9940b0365e..73698f42e0 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -79,7 +79,7 @@ INT_PTR CMraProto::MraCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, DlgProcAccount, LPARAM(this));
}
-int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
+void CMraProto::OnModulesLoaded()
{
HookProtoEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &CMraProto::MraExtraIconsApply);
HookProtoEvent(ME_OPT_INITIALISE, &CMraProto::OnOptionsInit);
@@ -110,15 +110,13 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM) // destroy all chat sessions
bChatExists = MraChatRegister();
- return 0;
}
-int CMraProto::OnShutdown(WPARAM, LPARAM)
+void CMraProto::OnShutdown()
{
m_bShutdown = true;
SetStatus(ID_STATUS_OFFLINE);
MraAvatarsQueueSuspend(hAvatarsQueueHandle);
- return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -245,7 +243,7 @@ int CMraProto::FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t*) /////////////////////////////////////////////////////////////////////////////////////////
-DWORD_PTR CMraProto::GetCaps(int type, MCONTACT)
+INT_PTR CMraProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -554,12 +552,9 @@ int CMraProto::UserIsTyping(MCONTACT hContact, int type) return 1;
}
-int CMraProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+int CMraProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM, LPARAM)
{
switch (eventType) {
- case EV_PROTO_ONLOAD: return OnModulesLoaded(0, 0);
- case EV_PROTO_ONEXIT: return OnShutdown(0, 0);
-
case EV_PROTO_ONMENU:
CListCreateMenu(2000060000, 500085000, TRUE, gdiMenuItems, MAIN_MENU_ITEMS_COUNT, hMainMenuItems);
break;
diff --git a/protocols/MRA/src/MraProto.h b/protocols/MRA/src/MraProto.h index be0302ea39..fa16b5fbcf 100644 --- a/protocols/MRA/src/MraProto.h +++ b/protocols/MRA/src/MraProto.h @@ -34,46 +34,48 @@ struct CMraProto : public PROTO<CMraProto> CMraProto(const char*, const wchar_t*);
~CMraProto();
- // ====================================================================================
+ //====================================================================================
// PROTO_INTERFACE
- // ====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
- virtual int __cdecl Authorize(MEVENT hDBEvent);
- virtual int __cdecl AuthDeny(MEVENT hDBEvent, const wchar_t* szReason);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
+ int Authorize(MEVENT hDBEvent) override;
+ int AuthDeny(MEVENT hDBEvent, const wchar_t* szReason) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
- virtual HANDLE __cdecl SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName);
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+ HANDLE SearchBasic(const wchar_t* id) override;
+ HANDLE SearchByEmail(const wchar_t* email) override;
+ HANDLE SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName) override;
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
- virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
+ int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
+ int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
- virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetApparentMode(MCONTACT hContact, int mode) override;
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t* msg);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t* msg) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
+ //====================================================================================
void ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode);
void MraPopupShowW(MCONTACT hContact, DWORD dwType, LPWSTR lpszTitle, LPCWSTR lpszMessage);
void MraPopupShowFromContactW(MCONTACT hContact, DWORD dwType, LPCWSTR lpszMessage);
@@ -144,8 +146,6 @@ struct CMraProto : public PROTO<CMraProto> INT_PTR __cdecl MraCreateAccMgrUI(WPARAM, LPARAM);
// ====| Events |======================================================================
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
- int __cdecl OnShutdown(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
int __cdecl OnPopupOptInit(WPARAM, LPARAM);
int __cdecl OnGroupChanged(WPARAM, LPARAM);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 94d2486d7e..8f48e29838 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -179,7 +179,7 @@ CMsnProto::~CMsnProto() FreeAuthTokens();
}
-int CMsnProto::OnModulesLoaded(WPARAM, LPARAM)
+void CMsnProto::OnModulesLoaded()
{
GCREGISTER gcr = {};
gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
@@ -193,11 +193,10 @@ int CMsnProto::OnModulesLoaded(WPARAM, LPARAM) HookProtoEvent(ME_IDLE_CHANGED, &CMsnProto::OnIdleChanged);
InitPopups();
- return 0;
}
// OnPreShutdown - prepare a global Miranda shutdown
-int CMsnProto::OnPreShutdown(WPARAM, LPARAM)
+void CMsnProto::OnShutdown()
{
g_bTerminated = true;
ReleaseSemaphore(hevAvatarQueue, 1, nullptr);
@@ -205,7 +204,6 @@ int CMsnProto::OnPreShutdown(WPARAM, LPARAM) Popup_UnregisterClass(hPopupError);
Popup_UnregisterClass(hPopupHotmail);
Popup_UnregisterClass(hPopupNotify);
- return 0;
}
// MsnAddToList - adds contact to the server list
@@ -236,7 +234,7 @@ MCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD return hContact;
}
-MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
+MCONTACT CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
{
wchar_t *id = psr->id.w ? psr->id.w : psr->email.w;
return AddToListByEmail(
@@ -245,7 +243,7 @@ MCONTACT __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) flags);
}
-MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent)
+MCONTACT CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent)
{
DBEVENTINFO dbei = {};
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
@@ -266,7 +264,7 @@ int CMsnProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre) }
// PSS_AUTHREQUEST
-int __cdecl CMsnProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
+int CMsnProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
{
if (msnLoggedIn) {
char email[MSN_MAX_EMAIL_LEN];
@@ -407,7 +405,7 @@ void __cdecl CMsnProto::MsnSearchAckThread(void* arg) }
-HANDLE __cdecl CMsnProto::SearchBasic(const wchar_t* id)
+HANDLE CMsnProto::SearchBasic(const wchar_t* id)
{
if (!msnLoggedIn) return nullptr;
@@ -417,7 +415,7 @@ HANDLE __cdecl CMsnProto::SearchBasic(const wchar_t* id) return email;
}
-HANDLE __cdecl CMsnProto::SearchByEmail(const wchar_t* email)
+HANDLE CMsnProto::SearchByEmail(const wchar_t* email)
{
return SearchBasic(email);
}
@@ -523,7 +521,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) }
// MsnFileAllow - starts the file transfer
-HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
+HANDLE CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -544,7 +542,7 @@ HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* s }
// MsnFileCancel - cancels the active file transfer
-int __cdecl CMsnProto::FileCancel(MCONTACT, HANDLE hTransfer)
+int CMsnProto::FileCancel(MCONTACT, HANDLE hTransfer)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -554,7 +552,7 @@ int __cdecl CMsnProto::FileCancel(MCONTACT, HANDLE hTransfer) }
// MsnFileDeny - rejects the file transfer request
-int __cdecl CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szReason*/)
+int CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szReason*/)
{
filetransfer* ft = (filetransfer*)hTransfer;
if (ft->tType == SERVER_HTTP)
@@ -564,7 +562,7 @@ int __cdecl CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szR }
// MsnFileResume - renames a file
-int __cdecl CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
+int CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
{
filetransfer* ft = (filetransfer*)hTransfer;
@@ -615,7 +613,7 @@ void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg) mir_free(inf);
}
-HANDLE __cdecl CMsnProto::GetAwayMsg(MCONTACT hContact)
+HANDLE CMsnProto::GetAwayMsg(MCONTACT hContact)
{
AwayMsgInfo* inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo));
inf->hContact = hContact;
@@ -626,7 +624,7 @@ HANDLE __cdecl CMsnProto::GetAwayMsg(MCONTACT hContact) }
// MsnGetCaps - obtain the protocol capabilities
-DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT)
+INT_PTR CMsnProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -647,7 +645,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT) return PF2_ONTHEPHONE;
case PFLAG_UNIQUEIDTEXT:
- return (UINT_PTR)Translate("Live ID");
+ return (INT_PTR)Translate("Live ID");
case PFLAG_MAXLENOFMESSAGE:
return 1202;
@@ -660,7 +658,7 @@ DWORD_PTR __cdecl CMsnProto::GetCaps(int type, MCONTACT) }
// MsnRecvMessage - creates a database event from the message been received
-int __cdecl CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
+int CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
{
char tEmail[MSN_MAX_EMAIL_LEN];
if (!db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail))
@@ -744,7 +742,7 @@ void CMsnProto::MsnFakeAck(void* arg) }
// MsnSendMessage - sends the message to a server
-int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
+int CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
{
const char *errMsg = nullptr;
@@ -827,7 +825,7 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) }
// MsnSendContacts - sends contacts to a certain user
-int __cdecl CMsnProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
+int CMsnProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
{
if (!msnLoggedIn)
return 0;
@@ -851,7 +849,7 @@ int __cdecl CMsnProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONT }
// MsnSetAwayMsg - sets the current status message for a user
-int __cdecl CMsnProto::SetAwayMsg(int status, const wchar_t* msg)
+int CMsnProto::SetAwayMsg(int status, const wchar_t* msg)
{
char** msgptr = GetStatusMsgLoc(status);
@@ -880,7 +878,7 @@ int __cdecl CMsnProto::SetAwayMsg(int status, const wchar_t* msg) }
// MsnSetStatus - set the plugin's connection status
-int __cdecl CMsnProto::SetStatus(int iNewStatus)
+int CMsnProto::SetStatus(int iNewStatus)
{
if (m_iDesiredStatus == iNewStatus) return 0;
@@ -926,7 +924,7 @@ int __cdecl CMsnProto::SetStatus(int iNewStatus) }
// MsnUserIsTyping - notify another contact that we're typing a message
-int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type)
+int CMsnProto::UserIsTyping(MCONTACT hContact, int type)
{
if (!msnLoggedIn) return 0;
@@ -943,7 +941,7 @@ int __cdecl CMsnProto::UserIsTyping(MCONTACT hContact, int type) }
// MsnSetApparentMode - controls contact visibility
-int __cdecl CMsnProto::SetApparentMode(MCONTACT hContact, int mode)
+int CMsnProto::SetApparentMode(MCONTACT hContact, int mode)
{
if (mode && mode != ID_STATUS_OFFLINE)
return 1;
@@ -955,15 +953,9 @@ int __cdecl CMsnProto::SetApparentMode(MCONTACT hContact, int mode) return 1;
}
-int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+int CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
switch (eventType) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(0, 0);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(0, 0);
-
case EV_PROTO_ONMENU:
MsnInitMainMenu();
break;
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h index e8a327452b..9e11b50b49 100644 --- a/protocols/MSN/src/msn_proto.h +++ b/protocols/MSN/src/msn_proto.h @@ -32,40 +32,42 @@ struct CMsnProto : public PROTO<CMsnProto> // PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override;
+ int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t* email);
+ HANDLE SearchBasic(const wchar_t* id) override;
+ HANDLE SearchByEmail(const wchar_t* email) override;
- virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
+ int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
+ int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
- virtual int __cdecl SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList);
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
+ int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
- virtual int __cdecl SetApparentMode(MCONTACT hContact, int mode);
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetApparentMode(MCONTACT hContact, int mode) override;
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t* msg);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t* msg) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//====| Services |====================================================================
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
@@ -88,10 +90,8 @@ struct CMsnProto : public PROTO<CMsnProto> int __cdecl OnContactDeleted(WPARAM wParam, LPARAM lParam);
int __cdecl OnIdleChanged(WPARAM wParam, LPARAM lParam);
int __cdecl OnGroupChange(WPARAM wParam, LPARAM lParam);
- int __cdecl OnModulesLoaded(WPARAM wParam, LPARAM lParam);
int __cdecl OnOptionsInit(WPARAM wParam, LPARAM lParam);
int __cdecl OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam);
- int __cdecl OnPreShutdown(WPARAM wParam, LPARAM lParam);
int __cdecl OnContactDoubleClicked(WPARAM wParam, LPARAM lParam);
int __cdecl OnDbSettingChanged(WPARAM wParam, LPARAM lParam);
int __cdecl OnWindowPopup(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp index 0c64aba806..0ea1bb8f9c 100644 --- a/protocols/MinecraftDynmap/src/proto.cpp +++ b/protocols/MinecraftDynmap/src/proto.cpp @@ -79,7 +79,7 @@ MinecraftDynmapProto::~MinecraftDynmapProto() ////////////////////////////////////////////////////////////////////////////// -DWORD_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT) +INT_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT) { switch(type) { case PFLAGNUM_1: @@ -89,7 +89,7 @@ DWORD_PTR MinecraftDynmapProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE: return MINECRAFTDYNMAP_MESSAGE_LIMIT; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR) Translate("Visible name"); + return (INT_PTR) Translate("Visible name"); } return 0; } @@ -132,12 +132,6 @@ int MinecraftDynmapProto::SetStatus(int new_status) int MinecraftDynmapProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam) { switch(event) { - case EV_PROTO_ONLOAD: - return OnModulesLoaded(wParam, lParam); - - case EV_PROTO_ONEXIT: - return OnPreShutdown (wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: return OnContactDeleted(wParam, lParam); } @@ -153,7 +147,7 @@ INT_PTR MinecraftDynmapProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) return (INT_PTR)CreateDialogParam(g_plugin.getInst(),MAKEINTRESOURCE(IDD_MinecraftDynmapACCOUNT), (HWND)lParam, MinecraftDynmapAccountProc, (LPARAM)this); } -int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM) +void MinecraftDynmapProto::OnModulesLoaded() { // Register group chat GCREGISTER gcr = {}; @@ -161,30 +155,11 @@ int MinecraftDynmapProto::OnModulesLoaded(WPARAM, LPARAM) gcr.ptszDispName = m_tszUserName; gcr.iMaxText = MINECRAFTDYNMAP_MESSAGE_LIMIT; Chat_Register(&gcr); - return 0; } -/*int MinecraftDynmapProto::OnOptionsInit(WPARAM wParam, LPARAM) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); - odp.szTitle.w = m_tszUserName; - odp.dwInitParam = LPARAM(this); - odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; - - odp.position = 271828; - odp.szGroup.w = LPGENW("Network"); - odp.szTab.w = LPGENW("Account"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); - odp.pfnDlgProc = MinecraftDynmapOptionsProc; - Options_AddPage(wParam, &odp); - return 0; -}*/ - -int MinecraftDynmapProto::OnPreShutdown(WPARAM, LPARAM) +void MinecraftDynmapProto::OnShutdown() { SetStatus(ID_STATUS_OFFLINE); - return 0; } int MinecraftDynmapProto::OnContactDeleted(WPARAM, LPARAM) diff --git a/protocols/MinecraftDynmap/src/proto.h b/protocols/MinecraftDynmap/src/proto.h index 1a19f2eae4..71c59a6fc9 100644 --- a/protocols/MinecraftDynmap/src/proto.h +++ b/protocols/MinecraftDynmap/src/proto.h @@ -41,19 +41,18 @@ public: } // PROTO_INTERFACE - virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL); - virtual int __cdecl SetStatus(int iNewStatus); - virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam); + INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override; + int SetStatus(int iNewStatus) override; + + int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override; + void OnModulesLoaded() override; + void OnShutdown() override; // Services INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM); // Events - int __cdecl OnModulesLoaded(WPARAM, LPARAM); - // int __cdecl OnOptionsInit(WPARAM, LPARAM); int __cdecl OnContactDeleted(WPARAM,LPARAM); - int __cdecl OnPreShutdown(WPARAM,LPARAM); - int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM); // Chat handling int __cdecl OnChatEvent(WPARAM,LPARAM); diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 470a0d70cc..80831a9293 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -79,7 +79,7 @@ OmegleProto::~OmegleProto() //////////////////////////////////////////////////////////////////////////////
-DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT)
+INT_PTR OmegleProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -91,7 +91,7 @@ DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE:
return OMEGLE_MESSAGE_LIMIT;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("Visible name");
+ return (INT_PTR)Translate("Visible name");
}
return 0;
}
@@ -135,12 +135,6 @@ int OmegleProto::SetStatus(int new_status) int OmegleProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
{
switch (event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(wParam, lParam);
-
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
}
@@ -157,7 +151,7 @@ INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam) (HWND)lParam, OmegleAccountProc, (LPARAM)this);
}
-int OmegleProto::OnModulesLoaded(WPARAM, LPARAM)
+void OmegleProto::OnModulesLoaded()
{
// Register group chat
GCREGISTER gcr = {};
@@ -166,8 +160,11 @@ int OmegleProto::OnModulesLoaded(WPARAM, LPARAM) gcr.ptszDispName = m_tszUserName;
gcr.iMaxText = OMEGLE_MESSAGE_LIMIT;
Chat_Register(&gcr);
+}
- return 0;
+void OmegleProto::OnShutdown()
+{
+ SetStatus(ID_STATUS_OFFLINE);
}
int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM)
@@ -187,12 +184,6 @@ int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM) return 0;
}
-int OmegleProto::OnPreShutdown(WPARAM, LPARAM)
-{
- SetStatus(ID_STATUS_OFFLINE);
- return 0;
-}
-
int OmegleProto::OnContactDeleted(WPARAM, LPARAM)
{
OnLeaveChat(NULL, NULL);
diff --git a/protocols/Omegle/src/proto.h b/protocols/Omegle/src/proto.h index ee6dd91f9d..90a114da31 100644 --- a/protocols/Omegle/src/proto.h +++ b/protocols/Omegle/src/proto.h @@ -45,23 +45,22 @@ public: // PROTO_INTERFACE
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetStatus(int iNewStatus) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
// Services
INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
// Events
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
int __cdecl OnContactDeleted(WPARAM, LPARAM);
- int __cdecl OnPreShutdown(WPARAM, LPARAM);
- int __cdecl OnPrebuildContactMenu(WPARAM, LPARAM);
// Chat handling
int __cdecl OnChatEvent(WPARAM, LPARAM);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 6adc868b82..3246dccc53 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -186,7 +186,7 @@ int CSametimeProto::OnIdleChanged(WPARAM, LPARAM lParam) return 0;
}
-int CSametimeProto::OnModulesLoaded(WPARAM, LPARAM)
+void CSametimeProto::OnModulesLoaded()
{
// register with chat module
GCREGISTER gcr = {};
@@ -194,15 +194,12 @@ int CSametimeProto::OnModulesLoaded(WPARAM, LPARAM) gcr.ptszDispName = m_tszUserName;
gcr.iMaxText = MAX_MESSAGE_SIZE;
Chat_Register(&gcr);
- return 0;
}
-int CSametimeProto::OnPreShutdown(WPARAM, LPARAM)
+void CSametimeProto::OnShutdown()
{
if (m_iStatus != ID_STATUS_OFFLINE)
LogOut();
-
- return 0;
}
int CSametimeProto::OnSametimeContactDeleted(WPARAM hContact, LPARAM)
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 94eb1a97d2..3a814b932a 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -31,8 +31,6 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const wchar_t* tszUserN CreateProtoService(PS_GETNAME, &CSametimeProto::GetName);
CreateProtoService(PS_LOADICON, &CSametimeProto::SametimeLoadIcon);
- HookProtoEvent(ME_SYSTEM_MODULESLOADED, &CSametimeProto::OnModulesLoaded);
- HookProtoEvent(ME_SYSTEM_PRESHUTDOWN, &CSametimeProto::OnPreShutdown);
HookProtoEvent(ME_MSG_WINDOWEVENT, &CSametimeProto::OnWindowEvent);
HookProtoEvent(ME_IDLE_CHANGED, &CSametimeProto::OnIdleChanged);
HookProtoEvent(ME_DB_CONTACT_DELETED, &CSametimeProto::OnSametimeContactDeleted);
@@ -112,7 +110,7 @@ int CSametimeProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** sz }
-DWORD_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact)
+INT_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact)
{
switch (type) {
case PFLAGNUM_1:
@@ -124,7 +122,7 @@ DWORD_PTR CSametimeProto::GetCaps(int type, MCONTACT hContact) case PFLAGNUM_4:
return PF4_SUPPORTTYPING;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)Translate("ID");
+ return (INT_PTR)Translate("ID");
case PFLAG_MAXLENOFMESSAGE:
return MAX_MESSAGE_SIZE;
default:
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h index e22186b16e..09923eeed3 100644 --- a/protocols/Sametime/src/sametime_proto.h +++ b/protocols/Sametime/src/sametime_proto.h @@ -15,45 +15,43 @@ struct CSametimeProto : public PROTO<CSametimeProto> //====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override;
+ int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+ HANDLE SearchBasic(const wchar_t* id) override;
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
- virtual int __cdecl RecvFile(MCONTACT hContact, PROTORECVFILE*);
- virtual int __cdecl RecvMsg(MCONTACT hContact, PROTORECVEVENT*);
+ int RecvFile(MCONTACT hContact, PROTORECVFILE*) override;
+ int RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
+ HANDLE SendFile(MCONTACT hContact, const wchar_t* szDescription, wchar_t** ppszFiles) override;
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt);
- virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
-
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
-
- virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt) override;
+ int SetAwayMsg(int iStatus, const wchar_t* msg) override;
+ int UserIsTyping(MCONTACT hContact, int type) override;
+ int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
// sametime.cpp
int __cdecl OnSametimeContactDeleted(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl GetName(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl SametimeLoadIcon(WPARAM wParam, LPARAM lParam);
int __cdecl OnWindowEvent(WPARAM wParam, LPARAM lParam);
- int __cdecl OnModulesLoaded(WPARAM wParam, LPARAM lParam);
- int __cdecl OnPreShutdown(WPARAM wParam, LPARAM lParam);
int __cdecl OnIdleChanged(WPARAM wParam, LPARAM lParam);
void SetAllOffline();
void BroadcastNewStatus(int iNewStatus);
diff --git a/protocols/SkypeWeb/src/skype_accounts.cpp b/protocols/SkypeWeb/src/skype_accounts.cpp index 9ab67acff8..bdc09aac6e 100644 --- a/protocols/SkypeWeb/src/skype_accounts.cpp +++ b/protocols/SkypeWeb/src/skype_accounts.cpp @@ -17,21 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-int CSkypeProto::OnAccountLoaded(WPARAM, LPARAM)
-{
- setAllContactStatuses(ID_STATUS_OFFLINE, true);
-
- HookProtoEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit);
- HookProtoEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnPreCreateMessage);
- HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CSkypeProto::OnDbEventRead);
-
- InitDBEvents();
- InitPopups();
- InitGroupChatModule();
-
- return 0;
-}
-
INT_PTR CSkypeProto::OnAccountManagerInit(WPARAM, LPARAM lParam)
{
return (INT_PTR)(CSkypeOptionsMain::CreateAccountManagerPage(this, (HWND)lParam))->GetHwnd();
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 459bfe04bf..e1a702e565 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -81,7 +81,20 @@ CSkypeProto::~CSkypeProto() SkypeUnsetTimer(); } -int CSkypeProto::OnExit() +void CSkypeProto::OnModulesLoaded() +{ + setAllContactStatuses(ID_STATUS_OFFLINE, true); + + HookProtoEvent(ME_OPT_INITIALISE, &CSkypeProto::OnOptionsInit); + HookProtoEvent(ME_MSG_PRECREATEEVENT, &CSkypeProto::OnPreCreateMessage); + HookProtoEvent(ME_DB_EVENT_MARKED_READ, &CSkypeProto::OnDbEventRead); + + InitDBEvents(); + InitPopups(); + InitGroupChatModule(); +} + +void CSkypeProto::OnShutdown() { debugLogA(__FUNCTION__); @@ -91,11 +104,9 @@ int CSkypeProto::OnExit() m_hPollingEvent.Set(); m_hTrouterEvent.Set(); - - return 0; } -DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT) +INT_PTR CSkypeProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -107,7 +118,7 @@ DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT) case PFLAGNUM_4: return PF4_FORCEADDED | PF4_NOAUTHDENYREASON | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_IMSENDOFFLINE | PF4_OFFLINEFILES; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR)Translate("Skypename"); + return (INT_PTR)Translate("Skypename"); } return 0; } @@ -290,17 +301,11 @@ int CSkypeProto::UserIsTyping(MCONTACT hContact, int type) int CSkypeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) { switch (iEventType) { - case EV_PROTO_ONLOAD: - return OnAccountLoaded(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: return OnContactDeleted(wParam, lParam); case EV_PROTO_ONMENU: return OnInitStatusMenu(); - - case EV_PROTO_ONEXIT: - return OnExit(); } return 1; diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index d9b7f1ec91..7162695ea3 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -37,23 +37,26 @@ public: //////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
- virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t* szReason);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const wchar_t* id);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
- virtual int __cdecl SetStatus(int iNewStatus);
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
- virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
- virtual int __cdecl RecvContacts(MCONTACT hContact, PROTORECVEVENT*);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int m_iStatus, const wchar_t *msg);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
+ MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override;
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
+ HANDLE SearchBasic(const wchar_t* id) override;
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
+ int SetStatus(int iNewStatus) override;
+ int UserIsTyping(MCONTACT hContact, int type) override;
+ int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int m_iStatus, const wchar_t *msg) override;
+
+ int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
// icons
static void InitIcons();
@@ -71,8 +74,8 @@ public: // events
static int OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnDbEventRead(WPARAM, LPARAM);
- int __cdecl OnExit();
- //search
+
+ // search
void __cdecl SearchBasicThread(void* id);
////////////////////////////////////////////
@@ -156,8 +159,6 @@ private: EventHandle m_hTrouterHealthEvent;
- int __cdecl OnAccountLoaded(WPARAM, LPARAM);
-
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
std::wstring m_tszAvatarFolder;
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp index 23a418f9e5..b74dc8305b 100644 --- a/protocols/Steam/src/steam_events.cpp +++ b/protocols/Steam/src/steam_events.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -int CSteamProto::OnModulesLoaded(WPARAM, LPARAM) +void CSteamProto::OnModulesLoaded() { Clist_GroupCreate(0, m_defaultGroup); @@ -16,7 +16,6 @@ int CSteamProto::OnModulesLoaded(WPARAM, LPARAM) dbEventType.eventType = EVENTTYPE_STEAM_CHATSTATES; dbEventType.descr = "Chat state notifications"; DbEvent_RegisterType(&dbEventType); - return 0; } INT_PTR CSteamProto::OnAccountManagerInit(WPARAM, LPARAM lParam) diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 6ca91ace53..ec77254b02 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -187,7 +187,7 @@ int CSteamProto::AuthRequest(MCONTACT hContact, const wchar_t*) return 1; } -DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT) +INT_PTR CSteamProto::GetCaps(int type, MCONTACT) { switch (type) { case PFLAGNUM_1: @@ -199,7 +199,7 @@ DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT) case PFLAGNUM_5: return PF2_HEAVYDND | PF2_OUTTOLUNCH | PF2_FREECHAT; case PFLAG_UNIQUEIDTEXT: - return (DWORD_PTR)Translate("SteamID"); + return (INT_PTR)Translate("SteamID"); default: return 0; } @@ -341,12 +341,9 @@ HANDLE CSteamProto::GetAwayMsg(MCONTACT hContact) return (HANDLE)1; } -int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) +int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM) { switch (eventType) { - case EV_PROTO_ONLOAD: - return OnModulesLoaded(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: if (IsOnline()) { MCONTACT hContact = (MCONTACT)wParam; @@ -356,17 +353,10 @@ int CSteamProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) ptrA sessionId(getStringA("SessionID")); ptrA steamId(getStringA("SteamID")); char *who = getStringA(hContact, "SteamID"); - PushRequest( - new RemoveFriendRequest(token, sessionId, steamId, who), - &CSteamProto::OnFriendRemoved, - (void*)who); + PushRequest(new RemoveFriendRequest(token, sessionId, steamId, who), &CSteamProto::OnFriendRemoved, (void*)who); } } return 0; - - case EV_PROTO_ONMENU: - //OnInitStatusMenu(); - break; } return 1; diff --git a/protocols/Steam/src/steam_proto.h b/protocols/Steam/src/steam_proto.h index 7638b0d73e..ef971cb2e9 100644 --- a/protocols/Steam/src/steam_proto.h +++ b/protocols/Steam/src/steam_proto.h @@ -55,25 +55,27 @@ public: ~CSteamProto();
// PROTO_INTERFACE
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthRecv(MCONTACT, PROTORECVEVENT*);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthRecv(MCONTACT, PROTORECVEVENT*) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetStatus(int iNewStatus) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
// menus
static void InitMenus();
@@ -223,11 +225,9 @@ protected: HICON GetXStatusIcon(int status, UINT flags);
int GetContactXStatus(MCONTACT hContact);
- HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
void __cdecl GetAwayMsgThread(void *arg);
// events
- int OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnIdleChanged(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl OnAccountManagerInit(WPARAM wParam, LPARAM lParam);
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp index c9cb35c921..2d02f68c4b 100644 --- a/protocols/Tox/src/tox_accounts.cpp +++ b/protocols/Tox/src/tox_accounts.cpp @@ -1,17 +1,5 @@ #include "stdafx.h"
-int CToxProto::OnAccountLoaded(WPARAM, LPARAM)
-{
- Clist_GroupCreate(0, m_defaultGroup);
-
- HookProtoEvent(ME_OPT_INITIALISE, &CToxProto::OnOptionsInit);
- HookProtoEvent(ME_USERINFO_INITIALISE, &CToxProto::OnUserInfoInit);
- HookProtoEvent(ME_MSG_PRECREATEEVENT, &CToxProto::OnPreCreateMessage);
-
- InitCustomDbEvents();
- return 0;
-}
-
int CToxProto::OnAccountRenamed(WPARAM, LPARAM)
{
mir_cslock lock(m_profileLock);
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);
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 90e6ab8e47..acf1cc0898 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -19,34 +19,35 @@ public: //////////////////////////////////////////////////////////////////////////////////////
// Virtual functions
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t* szMessage);
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override;
- virtual HANDLE __cdecl FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszPath);
- virtual int __cdecl FileCancel(MCONTACT hContact, HANDLE hTransfer);
- virtual int __cdecl FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszReason);
- virtual int __cdecl FileResume(HANDLE hTransfer, int* action, const wchar_t** tszFilename);
+ HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszPath) override;
+ int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
+ int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* tszReason) override;
+ int FileResume(HANDLE hTransfer, int* action, const wchar_t** tszFilename) override;
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL);
+ INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
- virtual HWND __cdecl SearchAdvanced(HWND owner);
- virtual HWND __cdecl CreateExtendedSearchUI(HWND owner);
+ HWND SearchAdvanced(HWND owner) override;
+ HWND CreateExtendedSearchUI(HWND owner) override;
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg);
+ int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles);
+ HANDLE SendFile(MCONTACT hContact, const wchar_t*, wchar_t **ppszFiles) override;
- virtual int __cdecl SetStatus(int iNewStatus);
+ int SetStatus(int iNewStatus) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT hContact);
- virtual int __cdecl SetAwayMsg(int iStatus, const wchar_t* msg);
+ HANDLE GetAwayMsg(MCONTACT hContact) override;
+ int SetAwayMsg(int iStatus, const wchar_t* msg) override;
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
+ int UserIsTyping(MCONTACT hContact, int type) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
+ int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
// icons
static void InitIcons();
@@ -114,7 +115,6 @@ private: void __cdecl PollingThread(void*);
// accounts
- int __cdecl OnAccountLoaded(WPARAM, LPARAM);
int __cdecl OnAccountRenamed(WPARAM, LPARAM);
INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM);
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 966d749c86..8f98d0e4b1 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -73,7 +73,7 @@ TwitterProto::~TwitterProto() // *************************
-DWORD_PTR TwitterProto::GetCaps(int type, MCONTACT)
+INT_PTR TwitterProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -88,7 +88,7 @@ DWORD_PTR TwitterProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE:
return 159; // 140 + <max length of a users name (15 apparently)> + 4 ("RT @"). this allows for the new style retweets
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) "Username";
+ return (INT_PTR) "Username";
}
return 0;
}
@@ -177,18 +177,6 @@ int TwitterProto::SetStatus(int new_status) // *************************
-int TwitterProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
-{
- switch (event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
- }
-
- return 1;
-}
-
-// *************************
-
INT_PTR TwitterProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
{
return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_TWITTERACCOUNT), (HWND)lParam, first_run_dialog, (LPARAM)this);
@@ -282,7 +270,7 @@ INT_PTR TwitterProto::OnTweet(WPARAM, LPARAM) return 0;
}
-int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
+void TwitterProto::OnModulesLoaded()
{
wchar_t descr[512];
NETLIBUSER nlu = {};
@@ -329,7 +317,6 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) setAllContactStatuses(ID_STATUS_OFFLINE); // In case we crashed last time
SetChatStatus(ID_STATUS_OFFLINE);
- return 0;
}
int TwitterProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
diff --git a/protocols/Twitter/src/proto.h b/protocols/Twitter/src/proto.h index 79fee1f1e0..077f105a6d 100644 --- a/protocols/Twitter/src/proto.h +++ b/protocols/Twitter/src/proto.h @@ -28,21 +28,21 @@ public: //PROTO_INTERFACE
- virtual MCONTACT __cdecl AddToList(int,PROTOSEARCHRESULT *);
+ MCONTACT AddToList(int,PROTOSEARCHRESULT *) override;
- virtual DWORD_PTR __cdecl GetCaps(int, MCONTACT = 0);
- virtual int __cdecl GetInfo(MCONTACT, int);
+ INT_PTR GetCaps(int, MCONTACT = 0) override;
+ int GetInfo(MCONTACT, int) override;
- virtual HANDLE __cdecl SearchBasic(const wchar_t *);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t *);
+ HANDLE SearchBasic(const wchar_t *) override;
+ HANDLE SearchByEmail(const wchar_t *) override;
- virtual int __cdecl SendMsg(MCONTACT, int, const char *);
+ int SendMsg(MCONTACT, int, const char *) override;
- virtual int __cdecl SetStatus(int);
+ int SetStatus(int) override;
- virtual HANDLE __cdecl GetAwayMsg(MCONTACT);
+ HANDLE GetAwayMsg(MCONTACT) override;
- virtual int __cdecl OnEvent(PROTOEVENTTYPE,WPARAM,LPARAM);
+ void OnModulesLoaded() override;
void UpdateSettings();
@@ -62,7 +62,6 @@ public: int __cdecl OnContactDeleted(WPARAM,LPARAM);
int __cdecl OnBuildStatusMenu(WPARAM,LPARAM);
int __cdecl OnOptionsInit(WPARAM,LPARAM);
- int __cdecl OnModulesLoaded(WPARAM,LPARAM);
int __cdecl OnPrebuildContactMenu(WPARAM,LPARAM);
int __cdecl OnChatOutgoing(WPARAM,LPARAM);
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 867329bdec..eaf507aabd 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -17,11 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
-static int sttCompareProtocols(const CVkProto *p1, const CVkProto *p2)
-{
- return mir_wstrcmp(p1->m_tszUserName, p2->m_tszUserName);
-}
-
static int sttCompareAsyncHttpRequest(const AsyncHttpRequest *p1, const AsyncHttpRequest *p2)
{
if (p1->m_priority == p2->m_priority)
@@ -92,7 +87,7 @@ CVkProto::~CVkProto() Popup_UnregisterClass(m_hPopupClassNotification);
}
-int CVkProto::OnModulesLoaded(WPARAM, LPARAM)
+void CVkProto::OnModulesLoaded()
{
Clist_GroupCreate(0, m_vkOptions.pwszDefaultGroup);
@@ -118,7 +113,6 @@ int CVkProto::OnModulesLoaded(WPARAM, LPARAM) InitPopups();
InitMenus();
InitDBCustomEvents();
- return 0;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -483,18 +477,17 @@ void CVkProto::InitDBCustomEvents() //////////////////////////////////////////////////////////////////////////////
-int CVkProto::OnPreShutdown(WPARAM, LPARAM)
+void CVkProto::OnShutdown()
{
debugLogA("CVkProto::OnPreShutdown");
m_bTerminated = true;
SetEvent(m_evRequestsQueue);
- return 0;
}
//////////////////////////////////////////////////////////////////////////////
-DWORD_PTR CVkProto::GetCaps(int type, MCONTACT)
+INT_PTR CVkProto::GetCaps(int type, MCONTACT)
{
switch (type) {
case PFLAGNUM_1:
@@ -518,7 +511,7 @@ DWORD_PTR CVkProto::GetCaps(int type, MCONTACT) return 4096;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR)"VKontakte ID";
+ return (INT_PTR)"VKontakte ID";
}
return 0;
}
@@ -528,12 +521,6 @@ DWORD_PTR CVkProto::GetCaps(int type, MCONTACT) int CVkProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
{
switch (event) {
- case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam, lParam);
-
- case EV_PROTO_ONEXIT:
- return OnPreShutdown(wParam, lParam);
-
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
}
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 5c050cf2a4..50e5924afe 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -52,26 +52,27 @@ struct CVkProto : public PROTO<CVkProto> // PROTO_INTERFACE
//====================================================================================
- virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr);
- virtual int __cdecl Authorize(MEVENT hDbEvent);
- virtual int __cdecl AuthDeny(MEVENT hDbEvent, const wchar_t *szReason);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const wchar_t *szMessage);
- virtual DWORD_PTR __cdecl GetCaps(int type, MCONTACT hContact = 0);
- virtual int __cdecl GetInfo(MCONTACT hContact, int infoType);
- virtual HANDLE __cdecl SearchBasic(const wchar_t *id);
- virtual HANDLE __cdecl SearchByEmail(const wchar_t *email);
- virtual HANDLE __cdecl SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName);
- virtual int __cdecl SendMsg(MCONTACT hContact, int flags, const char *msg);
- virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles);
- virtual int __cdecl SetStatus(int iNewStatus);
- virtual int __cdecl UserIsTyping(MCONTACT hContact, int type);
- virtual int __cdecl OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam);
+ MCONTACT AddToList(int flags, PROTOSEARCHRESULT *psr) override;
+ int Authorize(MEVENT hDbEvent) override;
+ int AuthDeny(MEVENT hDbEvent, const wchar_t *szReason) override;
+ int AuthRequest(MCONTACT hContact, const wchar_t *szMessage) override;
+ INT_PTR GetCaps(int type, MCONTACT hContact = 0) override;
+ int GetInfo(MCONTACT hContact, int infoType) override;
+ HANDLE SearchBasic(const wchar_t *id) override;
+ HANDLE SearchByEmail(const wchar_t *email) override;
+ HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override;
+ int SendMsg(MCONTACT hContact, int flags, const char *msg) override;
+ HANDLE SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override;
+ int SetStatus(int iNewStatus) override;
+ int UserIsTyping(MCONTACT hContact, int type) override;
+
+ int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
+ void OnModulesLoaded() override;
+ void OnShutdown() override;
//==== Events ========================================================================
- int __cdecl OnModulesLoaded(WPARAM, LPARAM);
int __cdecl OnOptionsInit(WPARAM, LPARAM);
- int __cdecl OnPreShutdown(WPARAM, LPARAM);
int __cdecl OnContactDeleted(WPARAM, LPARAM);
void OnOAuthAuthorize(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveAvatar(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
|