diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-30 18:59:38 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-30 18:59:38 +0000 |
commit | 10bc9e42dfba6ed8be41199243d688c2e367dc0d (patch) | |
tree | 891aca91eeb2feddb6c76498c4eb880689360fe6 /plugins/Spamotron | |
parent | 5dac5be47f2d9af8cbceead6511ff4c0fc40bab5 (diff) |
MS_CLIST_GETSTATUSMODEDESCRIPTION & MS_CLIST_GETCONTACTDISPLAYNAME replaced with pcli->* members
git-svn-id: http://svn.miranda-ng.org/main/trunk@14459 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r-- | plugins/Spamotron/src/common.h | 7 | ||||
-rw-r--r-- | plugins/Spamotron/src/spamotron.cpp | 19 | ||||
-rw-r--r-- | plugins/Spamotron/src/utils.cpp | 2 |
3 files changed, 4 insertions, 24 deletions
diff --git a/plugins/Spamotron/src/common.h b/plugins/Spamotron/src/common.h index ad4169fc21..acdc965c80 100644 --- a/plugins/Spamotron/src/common.h +++ b/plugins/Spamotron/src/common.h @@ -116,13 +116,6 @@ int LogToSystemHistory(char *message, char *origmessage); #define POPUP_APPROVED 2
#define POPUP_CHALLENGE 3
-#ifdef _UNICODE
-#define CONTACT_NAME(a) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)a, GCDNF_NOMYHANDLE | GCDNF_UNICODE | GCDNF_NOCACHE)
-#else
-#define CONTACT_NAME(a) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)a, GCDNF_NOMYHANDLE | GCDNF_NOCACHE)
-#endif
-
-
/* bayes.c */
#include "sqlite3\sqlite3.h"
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index 4101d8db4c..c0d76a9a9f 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -1,5 +1,6 @@ #include "common.h"
+CLIST_INTERFACE *pcli;
HINSTANCE hInst;
HANDLE hOptInitialize, hModulesLoaded, hDBContactAdded, hDBEventAdded, hDBEventFilterAdd;
time_t last_queue_check = 0;
@@ -19,8 +20,6 @@ PLUGININFOEX pluginInfo = { {0x14331048, 0x5a73, 0x4fdb, {0xb9, 0x09, 0x2d, 0x7e, 0x18, 0x25, 0xa0, 0x12}}
};
-
-
extern int OnOptInitialize(WPARAM wParam, LPARAM lParam);
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
@@ -36,18 +35,6 @@ int OnModulesLoaded(WPARAM, LPARAM) return 0;
}
-int OnDBContactAdded(WPARAM, LPARAM)
-{
- //MessageBox(NULL, _T("OnDBContactAdded"), _T("Event"), MB_OK);
- return 0;
-}
-
-int OnDBEventAdded(WPARAM wParam, LPARAM lParam)
-{
-
- return 0;
-}
-
int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
{
MCONTACT hContact = wParam;
@@ -523,6 +510,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) int Load()
{
mir_getLP(&pluginInfo);
+ mir_getCLI();
+
srand((unsigned)time(0));
bayesdb = NULL;
if (_getOptB("BayesEnabled", defaultBayesEnabled)) {
@@ -536,8 +525,6 @@ extern "C" __declspec(dllexport) int Load() }
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- hDBContactAdded = HookEvent(ME_DB_CONTACT_ADDED, OnDBContactAdded);
- hDBEventAdded = HookEvent(ME_DB_EVENT_ADDED, OnDBEventAdded);
hDBEventFilterAdd = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDBEventFilterAdd);
return 0;
}
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index 74e3f96bd5..98e1fa2901 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -428,7 +428,7 @@ int _notify(MCONTACT hContact, BYTE type, TCHAR *message, TCHAR *origmessage) { char *tmp, *tmporig; TCHAR msg[MAX_BUFFER_LENGTH]; - mir_sntprintf(msg, _countof(msg), message, CONTACT_NAME(hContact)); + mir_sntprintf(msg, _countof(msg), message, pcli->pfnGetContactDisplayName(hContact, 0)); if (_getOptB("LogActions", defaultLogActions)) { tmp = mir_u2a(msg); |