summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_protoint.h33
-rw-r--r--libs/win32/mir_app.libbin158470 -> 158370 bytes
-rw-r--r--libs/win64/mir_app.libbin153506 -> 153396 bytes
-rw-r--r--plugins/CloudFile/src/cloud_file.cpp15
-rw-r--r--plugins/CloudFile/src/cloud_file.h2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp21
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h2
-rw-r--r--protocols/MSN/src/msn_proto.cpp13
-rw-r--r--protocols/MSN/src/msn_proto.h3
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp6
-rw-r--r--protocols/Sametime/src/sametime_proto.h1
-rw-r--r--protocols/Tox/src/tox_profile.cpp3
-rw-r--r--protocols/Tox/src/tox_proto.cpp10
-rw-r--r--protocols/Tox/src/tox_proto.h3
-rw-r--r--src/mir_app/src/mir_app.def2
-rw-r--r--src/mir_app/src/mir_app64.def2
-rw-r--r--src/mir_app/src/proto_accs.cpp2
-rw-r--r--src/mir_app/src/proto_internal.cpp5
-rw-r--r--src/mir_app/src/proto_utils.cpp8
19 files changed, 45 insertions, 86 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 251308aea9..f7d9d15968 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -32,15 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_utils.h>
/////////////////////////////////////////////////////////////////////////////////////////
-// data types
-
-typedef enum
-{
- EV_PROTO_ONERASE,
-}
- PROTOEVENTTYPE;
-
-/////////////////////////////////////////////////////////////////////////////////////////
// protocol helpers
struct PROTO_INTERFACE;
@@ -218,16 +209,26 @@ public:
virtual int UserIsTyping(MCONTACT hContact, int type);
- virtual int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam);
-
//////////////////////////////////////////////////////////////////////////////////////
// events
- virtual void OnBuildProtoMenu(void);
- virtual void OnContactDeleted(MCONTACT);
- virtual void OnModulesLoaded(void); // the analog of ME_SYSTEM_MODULESLOADED for an account
- virtual void OnShutdown(void); // same for ME_SYSTEM_SHUTDOWN
- virtual bool IsReadyToExit(void); // same for ME_SYSTEM_OKTOEXIT
+ // builds the account's protocol menu
+ virtual void OnBuildProtoMenu(void);
+
+ // called when an account's contact is deleted
+ virtual void OnContactDeleted(MCONTACT);
+
+ // called when an account gets physically removed from the database
+ virtual void OnErase();
+
+ // the analog of ME_SYSTEM_MODULESLOADED for an account
+ virtual void OnModulesLoaded(void);
+
+ // same for ME_SYSTEM_SHUTDOWN
+ virtual void OnShutdown(void);
+
+ // same for ME_SYSTEM_OKTOEXIT
+ virtual bool IsReadyToExit(void);
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 1c468fe4fc..1a04380c6f 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index dc466f9c0f..ee2f776280 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/CloudFile/src/cloud_file.cpp b/plugins/CloudFile/src/cloud_file.cpp
index 3217716341..2c019cbd96 100644
--- a/plugins/CloudFile/src/cloud_file.cpp
+++ b/plugins/CloudFile/src/cloud_file.cpp
@@ -21,6 +21,11 @@ CCloudService::~CCloudService()
m_hConnection = nullptr;
}
+void CCloudService::OnErase()
+{
+ KillModuleMenus(m_hLangpack);
+}
+
int CCloudService::GetId() const
{
return m_hLangpack;
@@ -88,16 +93,6 @@ void CCloudService::OpenUploadDialog(MCONTACT hContact)
SetActiveWindow(it->second);
}
-int CCloudService::OnEvent(PROTOEVENTTYPE iEventType, WPARAM, LPARAM)
-{
- switch (iEventType) {
- case EV_PROTO_ONERASE:
- KillModuleMenus(m_hLangpack);
- return 0;
- }
- return 1;
-}
-
INT_PTR CCloudService::OnAccountManagerInit(WPARAM, LPARAM lParam)
{
CAccountManagerDlg *page = new CAccountManagerDlg(this);
diff --git a/plugins/CloudFile/src/cloud_file.h b/plugins/CloudFile/src/cloud_file.h
index 140102a9a2..f16d5affe4 100644
--- a/plugins/CloudFile/src/cloud_file.h
+++ b/plugins/CloudFile/src/cloud_file.h
@@ -24,6 +24,7 @@ protected:
virtual void HandleHttpError(NETLIBHTTPREQUEST *response);
virtual void HandleJsonError(JSONNode &node) = 0;
+ void OnErase() override;
void OnModulesLoaded() override;
JSONNode GetJsonResponse(NETLIBHTTPREQUEST *response);
@@ -37,7 +38,6 @@ public:
virtual ~CCloudService();
INT_PTR GetCaps(int type, MCONTACT) override;
- int OnEvent(PROTOEVENTTYPE iEventType, WPARAM, LPARAM) override;
int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
HANDLE SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles) override;
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 89222ebf96..ec5c940eaf 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -1809,18 +1809,13 @@ int CIcqProto::UserIsTyping(MCONTACT hContact, int type)
/////////////////////////////////////////////////////////////////////////////////////////
// OnEvent - maintain protocol events
-int CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
+void CIcqProto::OnErase()
{
- switch (eventType) {
- 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);
- break;
- }
- return 1;
+ 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);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index e653ef9a3b..e6cce5e4c6 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -93,8 +93,8 @@ struct CIcqProto : public PROTO<CIcqProto>
int UserIsTyping(MCONTACT hContact, int type) override;
- int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
void OnContactDeleted(MCONTACT) override;
+ void OnErase() override;
void OnModulesLoaded() override;
void OnShutdown() override;
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 276d1e7af2..1361d363e0 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -954,14 +954,9 @@ int CMsnProto::SetApparentMode(MCONTACT hContact, int mode)
return 1;
}
-int CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM, LPARAM)
+void CMsnProto::OnErase()
{
- switch (eventType) {
- case EV_PROTO_ONERASE:
- char szDbsettings[64];
- mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
- db_delete_module(0, szDbsettings);
- break;
- }
- return 1;
+ char szDbsettings[64];
+ mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
+ db_delete_module(0, szDbsettings);
}
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
index 20674b0986..da80f418fb 100644
--- a/protocols/MSN/src/msn_proto.h
+++ b/protocols/MSN/src/msn_proto.h
@@ -65,10 +65,9 @@ struct CMsnProto : public PROTO<CMsnProto>
int UserIsTyping(MCONTACT hContact, int type) override;
- int OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) override;
-
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ void OnErase() override;
void OnModulesLoaded() override;
void OnShutdown() override;
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 3a814b932a..9b6abed685 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -290,9 +290,3 @@ int CSametimeProto::UserIsTyping(MCONTACT hContact, int type)
SendTyping(hContact, type == PROTOTYPE_SELFTYPING_ON);
return 0;
}
-
-int CSametimeProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam)
-{
- return TRUE;
-}
-
diff --git a/protocols/Sametime/src/sametime_proto.h b/protocols/Sametime/src/sametime_proto.h
index 09923eeed3..84407541de 100644
--- a/protocols/Sametime/src/sametime_proto.h
+++ b/protocols/Sametime/src/sametime_proto.h
@@ -43,7 +43,6 @@ struct CSametimeProto : public PROTO<CSametimeProto>
int UserIsTyping(MCONTACT hContact, int type) override;
- int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
void OnModulesLoaded() override;
void OnShutdown() override;
diff --git a/protocols/Tox/src/tox_profile.cpp b/protocols/Tox/src/tox_profile.cpp
index 4458e0e6c7..76744445e5 100644
--- a/protocols/Tox/src/tox_profile.cpp
+++ b/protocols/Tox/src/tox_profile.cpp
@@ -142,11 +142,10 @@ void CToxProto::SaveToxProfile(Tox *tox)
mir_free(data);
}
-int CToxProto::OnDeleteToxProfile()
+void CToxProto::OnErase()
{
ptrW profilePath(GetToxProfilePath());
_wunlink(profilePath);
- return 0;
}
INT_PTR CToxProto::OnCopyToxID(WPARAM, LPARAM)
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index c8c66012a1..0ae5b521ec 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -224,13 +224,3 @@ int CToxProto::UserIsTyping(MCONTACT hContact, int type)
{
return OnUserIsTyping(hContact, type);
}
-
-int CToxProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM, LPARAM)
-{
- switch (iEventType) {
- case EV_PROTO_ONERASE:
- return OnDeleteToxProfile();
- }
-
- return 1;
-}
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h
index e29fceaa14..9e1ce07d97 100644
--- a/protocols/Tox/src/tox_proto.h
+++ b/protocols/Tox/src/tox_proto.h
@@ -46,9 +46,9 @@ public:
int UserIsTyping(MCONTACT hContact, int type) override;
- int OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM lParam) override;
void OnBuildProtoMenu(void) override;
void OnContactDeleted(MCONTACT) override;
+ void OnErase() override;
void OnModulesLoaded() override;
// icons
@@ -82,7 +82,6 @@ private:
bool LoadToxProfile(Tox_Options *options);
void SaveToxProfile(Tox *tox);
- int OnDeleteToxProfile();
INT_PTR __cdecl OnCopyToxID(WPARAM, LPARAM);
INT_PTR __cdecl OnCreatePassword(WPARAM, LPARAM);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 6dd0b637d3..aeaf4a8748 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -49,7 +49,6 @@ Skin_GetIconName @24
?GetCaps@PROTO_INTERFACE@@UAEHHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UAEHIH@Z @50 NONAME
?GetProtoInterface@CProtoIntDlgBase@@QAEPAUPROTO_INTERFACE@@XZ @51 NONAME
-?OnEvent@PROTO_INTERFACE@@UAEHW4PROTOEVENTTYPE@@IJ@Z @52 NONAME
?OnProtoActivate@CProtoIntDlgBase@@MAEXIJ@Z @53 NONAME
?OnProtoCheckOnline@CProtoIntDlgBase@@MAEXIJ@Z @54 NONAME
?OnProtoRefresh@CProtoIntDlgBase@@MAEXIJ@Z @55 NONAME
@@ -586,3 +585,4 @@ Proto_GetStatus @601
Contact_GetStatus @609
?OnContactDeleted@PROTO_INTERFACE@@UAEXI@Z @610 NONAME
?OnBuildProtoMenu@PROTO_INTERFACE@@UAEXXZ @611 NONAME
+?OnErase@PROTO_INTERFACE@@UAEXXZ @612 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index d702a1bae5..e6e57acbb1 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -49,7 +49,6 @@ Skin_GetIconName @24
?GetCaps@PROTO_INTERFACE@@UEAA_JHI@Z @49 NONAME
?GetInfo@PROTO_INTERFACE@@UEAAHIH@Z @50 NONAME
?GetProtoInterface@CProtoIntDlgBase@@QEAAPEAUPROTO_INTERFACE@@XZ @51 NONAME
-?OnEvent@PROTO_INTERFACE@@UEAAHW4PROTOEVENTTYPE@@_K_J@Z @52 NONAME
?OnProtoActivate@CProtoIntDlgBase@@MEAAX_K_J@Z @53 NONAME
?OnProtoCheckOnline@CProtoIntDlgBase@@MEAAX_K_J@Z @54 NONAME
?OnProtoRefresh@CProtoIntDlgBase@@MEAAX_K_J@Z @55 NONAME
@@ -586,3 +585,4 @@ Proto_GetStatus @601
Contact_GetStatus @609
?OnContactDeleted@PROTO_INTERFACE@@UEAAXI@Z @610 NONAME
?OnBuildProtoMenu@PROTO_INTERFACE@@UEAAXXZ @611 NONAME
+?OnErase@PROTO_INTERFACE@@UEAAXXZ @612 NONAME
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp
index 2dd3787ded..141f14c706 100644
--- a/src/mir_app/src/proto_accs.cpp
+++ b/src/mir_app/src/proto_accs.cpp
@@ -355,7 +355,7 @@ static int DeactivationThread(DeactivationThreadParam* param)
KillObjectEventHooks(p); // untie an object from the outside world
if (param->bErase)
- p->OnEvent(EV_PROTO_ONERASE, 0, 0);
+ p->OnErase();
if (param->fnUninit)
param->fnUninit(p);
diff --git a/src/mir_app/src/proto_internal.cpp b/src/mir_app/src/proto_internal.cpp
index 7218e2b2f1..4454e80439 100644
--- a/src/mir_app/src/proto_internal.cpp
+++ b/src/mir_app/src/proto_internal.cpp
@@ -280,11 +280,6 @@ struct DEFAULT_PROTO_INTERFACE : public PROTO_INTERFACE
CCSDATA ccs = { hContact, PSS_USERISTYPING, hContact, type };
return ProtoCallService(m_szModuleName, PSS_USERISTYPING, 0, (LPARAM)&ccs);
}
-
- virtual int OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM) override
- {
- return 1;
- }
};
// creates the default protocol container for compatibility with the old plugins
diff --git a/src/mir_app/src/proto_utils.cpp b/src/mir_app/src/proto_utils.cpp
index f7fd336010..08c7032a5d 100644
--- a/src/mir_app/src/proto_utils.cpp
+++ b/src/mir_app/src/proto_utils.cpp
@@ -182,6 +182,9 @@ void PROTO_INTERFACE::OnBuildProtoMenu()
void PROTO_INTERFACE::OnContactDeleted(MCONTACT)
{}
+void PROTO_INTERFACE::OnErase()
+{}
+
void PROTO_INTERFACE::OnModulesLoaded()
{}
@@ -576,8 +579,3 @@ int PROTO_INTERFACE::UserIsTyping(MCONTACT, int)
{
return 1; // error
}
-
-int PROTO_INTERFACE::OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM)
-{
- return 1; // not an error, vitally important
-}