summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-21 12:51:54 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-21 12:51:54 +0300
commit803e7b0b5e7c84a814601141fcb7634516eefa30 (patch)
tree20d3716dd44570773f131d7cce92dc3480f8eaed
parentca5001026a94f702c4012c5e8d2093ad3f51c1fa (diff)
EV_PROTO_DBSETTINGSCHANGED - old useless stub removed
-rw-r--r--include/m_protoint.h3
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp5
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.h41
-rw-r--r--protocols/IRCG/src/ircproto.cpp9
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp6
-rw-r--r--protocols/MSN/src/msn_proto.cpp4
-rw-r--r--src/mir_app/src/proto_accs.cpp13
8 files changed, 36 insertions, 49 deletions
diff --git a/include/m_protoint.h b/include/m_protoint.h
index 454b55a0c1..b48469749a 100644
--- a/include/m_protoint.h
+++ b/include/m_protoint.h
@@ -39,8 +39,7 @@ typedef enum
EV_PROTO_ONRENAME,
EV_PROTO_ONERASE,
EV_PROTO_ONMENU,
- EV_PROTO_ONCONTACTDELETED,
- EV_PROTO_DBSETTINGSCHANGED,
+ EV_PROTO_ONCONTACTDELETED
}
PROTOEVENTTYPE;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 7072330d25..3851e4ce7a 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -61,6 +61,8 @@ GaduProto::GaduProto(const char *pszProtoName, const wchar_t *tszUserName) :
CreateProtoService(PS_LEAVECHAT, &GaduProto::leavechat);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &GaduProto::dbsettingchanged);
+
// Offline contacts and clear logon time
setalloffline();
setDword(GG_KEY_LOGONTIME, 0);
@@ -738,9 +740,6 @@ int GaduProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
case EV_PROTO_ONCONTACTDELETED:
return contactdeleted(wParam, lParam);
-
- case EV_PROTO_DBSETTINGSCHANGED:
- return dbsettingchanged(wParam, lParam);
}
return TRUE;
diff --git a/protocols/Gadu-Gadu/src/gg_proto.h b/protocols/Gadu-Gadu/src/gg_proto.h
index dbec00c7ac..8445e52499 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.h
+++ b/protocols/Gadu-Gadu/src/gg_proto.h
@@ -61,20 +61,29 @@ struct GaduProto : public PROTO<GaduProto>
void OnShutdown() override;
//////////////////////////////////////////////////////////////////////////////////////
- // Services
+ // Services
INT_PTR __cdecl blockuser(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl getmyawaymsg(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl get_acc_mgr_gui(WPARAM wParam, LPARAM lParam);
INT_PTR __cdecl leavechat(WPARAM wParam, LPARAM lParam);
- void __cdecl sendackthread(void *);
- void __cdecl searchthread(void *);
- void __cdecl cmdgetinfothread(void *hContact);
- void __cdecl getawaymsgthread(void *hContact);
- void __cdecl dccmainthread(void *);
- void __cdecl ftfailthread(void *param);
- void __cdecl remindpasswordthread(void *param);
+ //////////////////////////////////////////////////////////////////////////////////////
+ // Threads
+
+ void __cdecl mainthread(void *empty);
+ void __cdecl sendackthread(void *);
+ void __cdecl searchthread(void *);
+ void __cdecl cmdgetinfothread(void *hContact);
+ void __cdecl getawaymsgthread(void *hContact);
+ void __cdecl dccmainthread(void *);
+ void __cdecl ftfailthread(void *param);
+ void __cdecl remindpasswordthread(void *param);
+
+ //////////////////////////////////////////////////////////////////////////////////////
+ // Events
+
+ int __cdecl dbsettingchanged(WPARAM wParam, LPARAM lParam);
//////////////////////////////////////////////////////////////////////////////////////
@@ -98,14 +107,12 @@ struct GaduProto : public PROTO<GaduProto>
void setalloffline();
void disconnect();
MCONTACT getcontact(uin_t uin, int create, int inlist, wchar_t *nick);
- void __cdecl mainthread(void *empty);
int isonline();
int refreshstatus(int status);
void broadcastnewstatus(int newStatus);
void cleanuplastplugin(DWORD version);
int contactdeleted(WPARAM wParam, LPARAM lParam);
- int dbsettingchanged(WPARAM wParam, LPARAM lParam);
void notifyall();
void changecontactstatus(uin_t uin, int status, const wchar_t *idescr, int time, uint32_t remote_ip, uint16_t remote_port, uint32_t version);
wchar_t *getstatusmsg(int status);
@@ -124,16 +131,16 @@ struct GaduProto : public PROTO<GaduProto>
void setAvatar(const wchar_t *szFilename);
bool getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts);
- INT_PTR __cdecl getavatarcaps(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl getavatarinfo(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl getmyavatar(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl setmyavatar(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl getavatarcaps(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl getavatarinfo(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl getmyavatar(WPARAM wParam, LPARAM lParam);
+ INT_PTR __cdecl setmyavatar(WPARAM wParam, LPARAM lParam);
void initavatarrequestthread();
- void __cdecl avatarrequestthread(void*);
- void __cdecl getOwnAvatarThread(void*);
- void __cdecl setavatarthread(void*);
+ void __cdecl avatarrequestthread(void*);
+ void __cdecl getOwnAvatarThread(void*);
+ void __cdecl setavatarthread(void*);
/* File transfer functions */
HANDLE dccfileallow(HANDLE hTransfer, const wchar_t* szPath);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index a5939a76a6..6152e22e88 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -64,6 +64,9 @@ CIrcProto::CIrcProto(const char* szModuleName, const wchar_t* tszUserName) :
CreateProtoService("/InsertGuiOut", &CIrcProto::Scripting_InsertGuiOut);
CreateProtoService("/GetIrcData", &CIrcProto::Scripting_GetIrcData);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CIrcProto::OnDbSettingChanged);
+ HookProtoEvent(ME_OPT_INITIALISE, &CIrcProto::OnInitOptionsPages);
+
codepage = CP_ACP;
InitPrefs();
@@ -258,8 +261,7 @@ void CIrcProto::OnModulesLoaded()
InitIgnore();
HookProtoEvent(ME_USERINFO_INITIALISE, &CIrcProto::OnInitUserInfo);
- HookProtoEvent(ME_OPT_INITIALISE, &CIrcProto::OnInitOptionsPages);
-
+
if (m_nick[0]) {
wchar_t szBuf[40];
if (mir_wstrlen(m_alternativeNick) == 0) {
@@ -819,9 +821,6 @@ int CIrcProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
-
- case EV_PROTO_DBSETTINGSCHANGED:
- return OnDbSettingChanged(wParam, lParam);
}
return 1;
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index 768b81881b..a2379109f8 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -85,6 +85,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
// Initialize server lists
HookProtoEvent(ME_CLIST_GROUPCHANGE, &CIcqProto::ServListCListGroupChange);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CIcqProto::ServListDbSettingChanged);
// Initialize status message struct
memset(&m_modeMsgs, 0, sizeof(icq_mode_messages));
@@ -1823,9 +1824,6 @@ int CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
case EV_PROTO_ONCONTACTDELETED:
return ServListDbContactDeleted(wParam, lParam);
-
- case EV_PROTO_DBSETTINGSCHANGED:
- return ServListDbSettingChanged(wParam, lParam);
}
return 1;
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index ea2a7ab003..801cb5bd0f 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -184,6 +184,7 @@ CJabberProto::CJabberProto(const char *aProtoName, const wchar_t *aUserName) :
HookProtoEvent(ME_LANGPACK_CHANGED, &CJabberProto::OnLangChanged);
HookProtoEvent(ME_OPT_INITIALISE, &CJabberProto::OnOptionsInit);
HookProtoEvent(ME_SKIN2_ICONSCHANGED, &CJabberProto::OnReloadIcons);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CJabberProto::OnDbSettingChanged);
m_iqManager.FillPermanentHandlers();
m_messageManager.FillPermanentHandlers();
@@ -425,7 +426,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
m_ThreadInfo->send(XmlNode(L"presence") << XATTR(L"to", newJid) << XATTR(L"type", L"subscribed"));
// Automatically add this user to my roster if option is enabled
- if (m_bAutoAdd == true) {
+ if (m_bAutoAdd) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, newJid);
if (item == nullptr || (item->subscription != SUB_BOTH && item->subscription != SUB_TO)) {
debugLogW(L"Try adding contact automatically jid = %s", blob.get_email());
@@ -1332,9 +1333,6 @@ int CJabberProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
-
- case EV_PROTO_DBSETTINGSCHANGED:
- return OnDbSettingChanged(wParam, lParam);
}
return 1;
}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 8f48e29838..7da11cc3ec 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -85,6 +85,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :
HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMsnProto::OnGroupChange);
HookProtoEvent(ME_OPT_INITIALISE, &CMsnProto::OnOptionsInit);
HookProtoEvent(ME_CLIST_DOUBLECLICKED, &CMsnProto::OnContactDoubleClicked);
+ HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMsnProto::OnDbSettingChanged);
LoadOptions();
@@ -968,9 +969,6 @@ int CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
case EV_PROTO_ONCONTACTDELETED:
return OnContactDeleted(wParam, lParam);
-
- case EV_PROTO_DBSETTINGSCHANGED:
- return OnDbSettingChanged(wParam, lParam);
}
return 1;
}
diff --git a/src/mir_app/src/proto_accs.cpp b/src/mir_app/src/proto_accs.cpp
index c2fda9e605..5dbb088efd 100644
--- a/src/mir_app/src/proto_accs.cpp
+++ b/src/mir_app/src/proto_accs.cpp
@@ -32,7 +32,7 @@ void BuildProtoMenus();
HICON Proto_GetIcon(PROTO_INTERFACE *ppro, int iconIndex);
static bool bModuleInitialized = false;
-static HANDLE hHooks[4];
+static HANDLE hHooks[3];
static int CompareAccounts(const PROTOACCOUNT* p1, const PROTOACCOUNT* p2)
{
@@ -200,16 +200,6 @@ static int OnContactDeleted(WPARAM hContact, LPARAM lParam)
return 0;
}
-static int OnDbSettingsChanged(WPARAM hContact, LPARAM lParam)
-{
- if (hContact) {
- PROTOACCOUNT *pa = Proto_GetAccount(hContact);
- if (pa->IsEnabled() && pa->ppro)
- pa->ppro->OnEvent(EV_PROTO_DBSETTINGSCHANGED, hContact, lParam);
- }
- return 0;
-}
-
static int InitializeStaticAccounts(WPARAM, LPARAM)
{
int count = 0;
@@ -273,7 +263,6 @@ int LoadAccountsModule(void)
hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, InitializeStaticAccounts);
hHooks[1] = HookEvent(ME_SYSTEM_PRESHUTDOWN, UninitializeStaticAccounts);
hHooks[2] = HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted);
- hHooks[3] = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbSettingsChanged);
return 0;
}