summaryrefslogtreecommitdiff
path: root/plugins/NewEventNotify
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-03-06 01:16:01 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-03-06 01:16:01 +0000
commit522586d7b8f7274fad2fe58c2615fc0d06618fcd (patch)
tree0a1e22eacb864e035af10f11021816d83163d974 /plugins/NewEventNotify
parentd5adcdbd5c1fda81f1be805dadc8021837ed706d (diff)
MRA
* Fix: SMS sending SMS * Fix: windows sizes then aero enabled * Fix: ICQEVENTTYPE_SMSCONFIRMATION db event write NewEventNotify + Add: support event types: ICQEVENTTYPE_SMS and ICQEVENTTYPE_SMSCONFIRMATION git-svn-id: http://svn.miranda-ng.org/main/trunk@8423 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewEventNotify')
-rw-r--r--plugins/NewEventNotify/src/neweventnotify.h5
-rw-r--r--plugins/NewEventNotify/src/popup.cpp34
2 files changed, 39 insertions, 0 deletions
diff --git a/plugins/NewEventNotify/src/neweventnotify.h b/plugins/NewEventNotify/src/neweventnotify.h
index 521ff9083a..31e6295c3d 100644
--- a/plugins/NewEventNotify/src/neweventnotify.h
+++ b/plugins/NewEventNotify/src/neweventnotify.h
@@ -132,6 +132,11 @@
#define POPUP_COMMENT_AUTH LPGEN("Requests your authorization")
#define POPUP_COMMENT_WEBPAGER LPGEN("ICQ Web pager")
#define POPUP_COMMENT_EMAILEXP LPGEN("ICQ Email express")
+
+#define ICQEVENTTYPE_SMSCONFIRMATION 3001
+#define POPUP_COMMENT_SMS LPGEN("SMS Message")
+#define POPUP_COMMENT_SMSCONFIRMATION LPGEN("SMS Confirmation")
+
#define POPUP_COMMENT_OTHER LPGEN("Unknown Event")
#define MENUITEM_NAME LPGEN("Notify of new events")
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index d1d196dc9e..835a05102a 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -334,6 +334,40 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
commentFix = POPUP_COMMENT_EMAILEXP;
break;
+ //blob format is:
+ //ASCIIZ text, usually of the form "SMS From: +XXXXXXXX\r\nTEXT"
+ case ICQEVENTTYPE_SMS:
+ if (dbei->pBlob) {
+ if (dbei->flags & DBEF_UTF) {
+ // utf-8 in blob
+ comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ }
+ else if (dbei->cbBlob == (_tcslen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ // wchar in blob (the old hack)
+ comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ }
+ else comment1 = mir_a2t((char *)dbei->pBlob);
+ }
+ commentFix = POPUP_COMMENT_SMS;
+ break;
+
+ //blob format is:
+ //ASCIIZ text, usually of the form "SMS Confirmation From: +XXXXXXXXXXXX\r\nSMS was sent succesfully"
+ case ICQEVENTTYPE_SMSCONFIRMATION:
+ if (dbei->pBlob) {
+ if (dbei->flags & DBEF_UTF) {
+ // utf-8 in blob
+ comment1 = mir_utf8decodeT((char*)dbei->pBlob);
+ }
+ else if (dbei->cbBlob == (_tcslen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ // wchar in blob (the old hack)
+ comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
+ }
+ else comment1 = mir_a2t((char *)dbei->pBlob);
+ }
+ commentFix = POPUP_COMMENT_SMSCONFIRMATION;
+ break;
+
default:
if (ServiceExists(MS_DB_EVENT_GETTYPE)) {
DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);