diff options
-rw-r--r-- | message_notify/MessageNotify.mdsp | 2 | ||||
-rw-r--r-- | message_notify/messagenotify.cpp | 30 |
2 files changed, 17 insertions, 15 deletions
diff --git a/message_notify/MessageNotify.mdsp b/message_notify/MessageNotify.mdsp index e1a2758..5ac68f7 100644 --- a/message_notify/MessageNotify.mdsp +++ b/message_notify/MessageNotify.mdsp @@ -98,4 +98,4 @@ extraResourceOptions= options.cpp,5169
popups.cpp,6075
common.h,643
-messagenotify.cpp,0
+messagenotify.cpp,518
diff --git a/message_notify/messagenotify.cpp b/message_notify/messagenotify.cpp index f5de3e3..fe37a28 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,0,1),
+ PLUGIN_MAKE_VERSION(0,2,0,3),
"Show a popup when a message is received",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -197,21 +197,23 @@ unsigned int __stdcall sttCheckWindowProc( VOID *dwParam ) { }
}
- wchar_t *msg;
- int msglen = strlen((char *)cd->blob) + 1;
+ wchar_t *msg = 0;
// does blob contain unicode message?
- if(msglen != cd->blobsize && wcslen((wchar_t *)(&cd->blob[msglen]))) {
- // yes
- msg = (wchar_t *)(&cd->blob[msglen]);
- ShowPopupW(cd->hContact, swzContactDisplayName, msg);
- } else if(cd->blobsize) {
- // no, convert to unciode
- int size = MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, 0, 0);
- msg = (wchar_t *) malloc(sizeof(wchar_t) * size);
- MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, size);
- ShowPopupW(cd->hContact, swzContactDisplayName, msg);
- free(msg);
+ if(cd->blobsize) {
+ int msglen = strlen((char *)cd->blob) + 1;
+ if(msglen != cd->blobsize && wcslen((wchar_t *)(&cd->blob[msglen]))) {
+ // yes
+ msg = (wchar_t *)(&cd->blob[msglen]);
+ ShowPopupW(cd->hContact, swzContactDisplayName, msg);
+ } else {
+ // no, convert to unciode
+ int size = MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, 0, 0);
+ msg = (wchar_t *) malloc(sizeof(wchar_t) * size);
+ MultiByteToWideChar(code_page, 0, (char *) cd->blob, -1, msg, size);
+ ShowPopupW(cd->hContact, swzContactDisplayName, msg);
+ free(msg);
+ }
} else { // no message
ShowPopupW(cd->hContact, swzContactDisplayName, 0);
}
|