From 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Jan 2015 17:49:54 +0000 Subject: MEVENT - the strict type for events, they are not HANDLE anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SMS/src/SMS_svc.cpp | 4 ++-- plugins/SMS/src/receive.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'plugins/SMS') diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 05678d0046..6e594bea8e 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -135,7 +135,7 @@ void RestoreUnreadMessageAlerts(void) DBEVENTINFO dbei = { sizeof(dbei) }; for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) - for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) { dbei.cbBlob = 0; if (db_event_get(hDbEvent, &dbei) == 0) if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION))) @@ -143,7 +143,7 @@ void RestoreUnreadMessageAlerts(void) handleNewMessage(hContact,(LPARAM)hDbEvent); } - for (HANDLE hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) { + for (MEVENT hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(NULL, hDbEvent)) { dbei.cbBlob = 0; if (db_event_get(hDbEvent, &dbei) == 0) if ((dbei.flags & (DBEF_SENT|DBEF_READ))==0 && ((dbei.eventType==ICQEVENTTYPE_SMS) || (dbei.eventType==ICQEVENTTYPE_SMSCONFIRMATION))) diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp index fa2d31764f..813cd77ffd 100644 --- a/plugins/SMS/src/receive.cpp +++ b/plugins/SMS/src/receive.cpp @@ -74,7 +74,7 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) dbei.cbBlob=(mir_snprintf((LPSTR)dbei.pBlob,((dwBuffLen+dwPhoneSize)),"SMS From: +%s\r\n%s",szPhone,lpszMessageUTF)+sizeof(DWORD)); //dbei.pBlob=(LPBYTE)lpszBuff; (*((DWORD*)(dbei.pBlob+(dbei.cbBlob-sizeof(DWORD)))))=0; - HANDLE hResult = db_event_add(hContact, &dbei); + MEVENT hResult = db_event_add(hContact, &dbei); if (hContact==NULL) { if ( RecvSMSWindowAdd(NULL,ICQEVENTTYPE_SMS,tszPhone,dwPhoneSize,(LPSTR)dbei.pBlob,dbei.cbBlob)) { db_event_markRead(hContact, hResult); @@ -212,11 +212,10 @@ int handleAckSMS(WPARAM wParam, LPARAM lParam) } //Handles new SMS messages added to the database -int handleNewMessage(WPARAM hContact, LPARAM lParam) +int handleNewMessage(WPARAM hContact, LPARAM hDbEvent) { char szServiceFunction[MAX_PATH], *pszServiceFunctionName; TCHAR szToolTip[MAX_PATH]; - HANDLE hDbEvent = (HANDLE)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1) @@ -256,7 +255,7 @@ int handleNewMessage(WPARAM hContact, LPARAM lParam) SkinPlaySound("RecvSMSConfirmation"); if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) { if (RecvSMSWindowAdd(hContact,ICQEVENTTYPE_SMSCONFIRMATION,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob)) - db_event_delete(hContact, &dbei); + db_event_delete(hContact, hDbEvent); } else { UINT iIcon; -- cgit v1.2.3