summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NewEventNotify')
-rw-r--r--plugins/NewEventNotify/src/main.cpp17
-rw-r--r--plugins/NewEventNotify/src/popup.cpp2
2 files changed, 6 insertions, 13 deletions
diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp
index 63fd90ea86..086a51f325 100644
--- a/plugins/NewEventNotify/src/main.cpp
+++ b/plugins/NewEventNotify/src/main.cpp
@@ -30,6 +30,7 @@ extern PLUGIN_DATA* PopupList[20];
//---------------------------
//---Some global variables for the plugin
+CLIST_INTERFACE *pcli;
HINSTANCE hInst;
PLUGIN_OPTIONS pluginOptions;
int hLangpack;
@@ -50,12 +51,6 @@ PLUGININFOEX pluginInfo = {
//---------------------------
//---Hooks
-//---Handles to my hooks, needed to unhook them again
-HANDLE hHookedInit;
-HANDLE hHookedOpt;
-HANDLE hHookedNewEvent;
-HANDLE hHookedDeletedEvent;
-
//---Called when a new event is added to the database
//wParam: contact-handle
//lParam: dbevent-handle
@@ -113,7 +108,7 @@ int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent)
//---Called when all the modules are loaded
int HookedInit(WPARAM, LPARAM)
{
- hHookedNewEvent = HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent);
+ HookEvent(ME_DB_EVENT_ADDED, HookedNewEvent);
// Plugin sweeper support
if (ServiceExists("PluginSweeper/Add"))
CallService("PluginSweeper/Add", (WPARAM)MODULE, (LPARAM)MODULE);
@@ -142,10 +137,11 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) int Load(void)
{
- hHookedInit = HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
- hHookedOpt = HookEvent(ME_OPT_INITIALISE, HookedOptions);
+ HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
+ HookEvent(ME_OPT_INITIALISE, HookedOptions);
mir_getLP(&pluginInfo);
+ mir_getCLI();
OptionsInit(&pluginOptions);
pluginOptions.hInst = hInst;
@@ -155,9 +151,6 @@ extern "C" __declspec(dllexport) int Load(void)
extern "C" __declspec(dllexport) int Unload(void)
{
- UnhookEvent(hHookedNewEvent);
- UnhookEvent(hHookedOpt);
- UnhookEvent(hHookedInit);
return 0;
}
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 487aa7d1fc..d3dfa415f7 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -494,7 +494,7 @@ int PopupShow(PLUGIN_OPTIONS* pluginOptions, MCONTACT hContact, MEVENT hEvent, U
_tcsncpy(pudw.lptzText, TranslateTS(sampleEvent), MAX_SECONDLINE);
}
else { // get the needed event data
- _tcsncpy(pudw.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), MAX_CONTACTNAME);
+ _tcsncpy(pudw.lptzContactName, (TCHAR*)pcli->pfnGetContactDisplayName(hContact, 0), MAX_CONTACTNAME);
_tcsncpy(pudw.lptzText, ptrT(GetEventPreview(&dbe)), MAX_SECONDLINE);
}