summaryrefslogtreecommitdiff
path: root/message_notify
diff options
context:
space:
mode:
Diffstat (limited to 'message_notify')
-rw-r--r--message_notify/MessageNotify.mdsp8
-rw-r--r--message_notify/messagenotify.cpp13
2 files changed, 14 insertions, 7 deletions
diff --git a/message_notify/MessageNotify.mdsp b/message_notify/MessageNotify.mdsp
index 7bb841a..9e7f15e 100644
--- a/message_notify/MessageNotify.mdsp
+++ b/message_notify/MessageNotify.mdsp
@@ -94,8 +94,10 @@ extraResourceOptions=
[Resource]
1=resource.rc
[Other]
+1=..\..\include\m_database.h
[History]
-common.h,643
-popups.cpp,6075
options.cpp,5169
-messagenotify.cpp,518
+popups.cpp,6075
+common.h,643
+..\..\include\m_database.h,16859
+messagenotify.cpp,726
diff --git a/message_notify/messagenotify.cpp b/message_notify/messagenotify.cpp
index 1e7628a..437b614 100644
--- a/message_notify/messagenotify.cpp
+++ b/message_notify/messagenotify.cpp
@@ -27,7 +27,7 @@ DWORD focusTimerId = 0;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
"Message Notify",
- PLUGIN_MAKE_VERSION(0,2,1,0),
+ PLUGIN_MAKE_VERSION(0,2,2,0),
"Show a popup when a message is received",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -162,6 +162,7 @@ typedef struct {
HANDLE hContact;
BYTE *blob;
int blobsize;
+ int flags;
HANDLE hEvent;
} CheckWindowData;
@@ -203,7 +204,10 @@ unsigned int __stdcall sttCheckWindowProc( VOID *dwParam ) {
} else {
// no, convert to unciode
wchar_t msg[MAX_SECONDLINE];
- MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
+ if(cd->flags & DBEF_UTF)
+ MultiByteToWideChar(CP_UTF8, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
+ else
+ MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, MAX_SECONDLINE);
ShowPopupW(cd->hContact, swzContactDisplayName, msg);
}
} else {
@@ -262,6 +266,7 @@ int OnDatabaseEventPreAdd(WPARAM wParam, LPARAM lParam) {
// copy blob data
cd->blobsize = dbei->cbBlob;
cd->blob = new BYTE[cd->blobsize];
+ cd->flags = dbei->flags;
memcpy(cd->blob, dbei->pBlob, cd->blobsize);
} else
cd->blobsize = 0;
@@ -331,12 +336,14 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
metacontacts_installed = (ServiceExists(MS_MC_GETMETACONTACT) != 0);
+ hEventDbEventAdded = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDatabaseEventPreAdd);
hIdle = HookEvent(ME_IDLE_CHANGED, OnIdleChanged);
hWindowEvent = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
if(options.notify_when == NOTIFY_NFORE)
StartFocusTimer();
+
return 0;
}
@@ -387,8 +394,6 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
popupWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- hEventDbEventAdded = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDatabaseEventPreAdd);
-
return 0;
}