#include "common.h" int LoadServices(void) { CHAR szServiceFunction[MAX_PATH],*pszServiceFunctionName; CopyMemory(szServiceFunction,PROTOCOL_NAMEA,PROTOCOL_NAME_SIZE); pszServiceFunctionName=szServiceFunction+PROTOCOL_NAME_LEN; // Service creation for (SIZE_T i=0;ihDbEvent)) != -1) { dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob); if (db_event_get(cle->hDbEvent, &dbei) == 0) if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) { if (RecvSMSWindowAdd(cle->hContact,ICQEVENTTYPE_SMS,NULL,0,(LPSTR)dbei.pBlob,dbei.cbBlob)) { db_event_markRead(cle->hContact, cle->hDbEvent); return 0; } } } return 1; } //This function used to popup a read SMS window after the user clicked on the received SMS confirmation. int ReadAckSMS(WPARAM wParam,LPARAM lParam) { CLISTEVENT *cle = (CLISTEVENT*)lParam; DBEVENTINFO dbei = { sizeof(dbei) }; if ((dbei.cbBlob = db_event_getBlobSize(cle->hDbEvent)) != -1) { dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob); if (db_event_get(cle->hDbEvent, &dbei) == 0) if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) { if (RecvSMSWindowAdd(cle->hContact, ICQEVENTTYPE_SMSCONFIRMATION, NULL, 0, (LPSTR)dbei.pBlob, dbei.cbBlob)) { db_event_delete(cle->hContact, cle->hDbEvent); return 0; } } } return 1; } void RestoreUnreadMessageAlerts(void) { DBEVENTINFO dbei = { sizeof(dbei) }; for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) for (HANDLE hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(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))) if (dbei.cbBlob>MIN_SMS_DBEVENT_LEN) handleNewMessage((WPARAM)hContact,(LPARAM)hDbEvent); } for (HANDLE hDbEvent = db_event_firstUnread(NULL); hDbEvent; hDbEvent = db_event_next(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))) if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) handleNewMessage(NULL, (LPARAM)hDbEvent); } }