summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-06-09 18:05:49 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-06-09 18:05:49 +0000
commitf2bc6761680a9f7fca23eb68331570b734aa682f (patch)
treef2b582a6e2c364232b713fe9db754d977b15b342
parent08572c6065ebb0f3d0fb05c5abd291b083883a54 (diff)
MessageState: Cleanup.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14083 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/MessageState/src/global.h3
-rw-r--r--plugins/MessageState/src/main.cpp8
-rw-r--r--plugins/MessageState/src/messagestate.cpp10
3 files changed, 9 insertions, 12 deletions
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);