diff options
Diffstat (limited to 'plugins/NewEventNotify/src')
-rw-r--r-- | plugins/NewEventNotify/src/neweventnotify.h | 5 | ||||
-rw-r--r-- | plugins/NewEventNotify/src/popup.cpp | 34 |
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);
|