summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/MessageState/src/global.h1
-rw-r--r--plugins/MessageState/src/main.cpp1
-rw-r--r--plugins/MessageState/src/messagestate.cpp15
-rw-r--r--plugins/MessageState/src/stdafx.h2
4 files changed, 17 insertions, 2 deletions
diff --git a/plugins/MessageState/src/global.h b/plugins/MessageState/src/global.h
index c3fac26cd7..51af6636ac 100644
--- a/plugins/MessageState/src/global.h
+++ b/plugins/MessageState/src/global.h
@@ -24,5 +24,6 @@ enum SRMM_ICON_TYPE
#define DBKEY_MESSAGE_READ_TIME "LastMsgReadTime"
int OnModulesLoaded(WPARAM, LPARAM);
+void UnInitModule();
#endif //_GLOBAL_H_ \ No newline at end of file
diff --git a/plugins/MessageState/src/main.cpp b/plugins/MessageState/src/main.cpp
index a61065abb0..6b6321a29f 100644
--- a/plugins/MessageState/src/main.cpp
+++ b/plugins/MessageState/src/main.cpp
@@ -39,5 +39,6 @@ extern "C" int __declspec(dllexport) Load(void)
extern "C" int __declspec(dllexport) Unload(void)
{
+ UnInitModule();
return 0;
} \ No newline at end of file
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp
index 8f8d450730..3595553ee1 100644
--- a/plugins/MessageState/src/messagestate.cpp
+++ b/plugins/MessageState/src/messagestate.cpp
@@ -1,5 +1,7 @@
#include "stdafx.h"
+HANDLE hDummyService;
+
LONGLONG GetLastSentMessageTime(MCONTACT hContact)
{
for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent))
@@ -87,7 +89,7 @@ int IconsUpdate(WPARAM hContact, LONGLONG readtime)
return 0;
}
-int OnProtoAck(WPARAM wParam, LPARAM lParam)
+int OnProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *pAck = (ACKDATA *)lParam;
if (pAck && pAck->type == ACKTYPE_MESSAGE && CheckProtoSupport(GetContactProto(pAck->hContact)))
@@ -140,12 +142,23 @@ int OnSrmmWindowEvent(WPARAM, LPARAM lParam)
return 0;
}
+INT_PTR DummyService(WPARAM, LPARAM){ return 0; }
+
+void UnInitModule()
+{
+ if (hDummyService)
+ DestroyServiceFunction(hDummyService);
+}
+
int OnModulesLoaded(WPARAM, LPARAM)
{
HookEvent(ME_MSG_WINDOWEVENT, OnSrmmWindowEvent);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged);
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);
diff --git a/plugins/MessageState/src/stdafx.h b/plugins/MessageState/src/stdafx.h
index f0a5e45916..fab1d17e96 100644
--- a/plugins/MessageState/src/stdafx.h
+++ b/plugins/MessageState/src/stdafx.h
@@ -20,4 +20,4 @@
#define MODULENAME "MessageState"
-extern HINSTANCE g_hInst; \ No newline at end of file
+extern HINSTANCE g_hInst;