From f2bc6761680a9f7fca23eb68331570b734aa682f Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Tue, 9 Jun 2015 18:05:49 +0000 Subject: MessageState: Cleanup. git-svn-id: http://svn.miranda-ng.org/main/trunk@14083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MessageState/src/global.h | 3 ++- plugins/MessageState/src/main.cpp | 8 +++++++- plugins/MessageState/src/messagestate.cpp | 10 ---------- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'plugins/MessageState/src') diff --git a/plugins/MessageState/src/global.h b/plugins/MessageState/src/global.h index 991d737d96..7855f73b5c 100644 --- a/plugins/MessageState/src/global.h +++ b/plugins/MessageState/src/global.h @@ -24,6 +24,7 @@ enum SRMM_ICON_TYPE #define DBKEY_MESSAGE_READ_TIME "LastMsgReadTime" int OnModulesLoaded(WPARAM, LPARAM); -void UnInitModule(); +INT_PTR DummyService(WPARAM, LPARAM); + #endif //_GLOBAL_H_ \ No newline at end of file diff --git a/plugins/MessageState/src/main.cpp b/plugins/MessageState/src/main.cpp index 6b6321a29f..b2caea0d74 100644 --- a/plugins/MessageState/src/main.cpp +++ b/plugins/MessageState/src/main.cpp @@ -2,6 +2,7 @@ int hLangpack; HINSTANCE g_hInst; +HANDLE hDummyService; PLUGININFOEX pluginInfo = { @@ -34,11 +35,16 @@ extern "C" int __declspec(dllexport) Load(void) { mir_getLP(&pluginInfo); HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + + hDummyService = CreateServiceFunction(MODULENAME "/DummyService", DummyService); + return 0; } extern "C" int __declspec(dllexport) Unload(void) { - UnInitModule(); + if (hDummyService) + DestroyServiceFunction(hDummyService); + return 0; } \ No newline at end of file diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index d1c6a240c6..34380e4678 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -1,7 +1,5 @@ #include "stdafx.h" -HANDLE hDummyService; - LONGLONG GetLastSentMessageTime(MCONTACT hContact) { for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) @@ -144,12 +142,6 @@ int OnSrmmWindowEvent(WPARAM, LPARAM lParam) INT_PTR DummyService(WPARAM, LPARAM){ return 0; } -void UnInitModule() -{ - if (hDummyService) - DestroyServiceFunction(hDummyService); -} - int OnModulesLoaded(WPARAM, LPARAM) { HookEvent(ME_MSG_WINDOWEVENT, OnSrmmWindowEvent); @@ -157,8 +149,6 @@ int OnModulesLoaded(WPARAM, LPARAM) HookEvent(ME_PROTO_ACK, OnProtoAck); HookEvent(ME_DB_EVENT_FILTER_ADD, OnEventFilterAdd); - hDummyService = CreateServiceFunction(MODULENAME "/DummyService", DummyService); - // IcoLib support for (size_t i = 0; i < SIZEOF(Icons); i++) Icon_Register(g_hInst, MODULENAME, &Icons[i], 1); -- cgit v1.2.3