From 109877a3c75cb290c55755dcfc88794d2453669d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 30 Mar 2013 17:32:39 +0000 Subject: MS_DB_EVENT_* services remained, but their calls removed git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdurl/url.cpp | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) (limited to 'src/core/stdurl/url.cpp') diff --git a/src/core/stdurl/url.cpp b/src/core/stdurl/url.cpp index 9f97c4288e..68818744b4 100644 --- a/src/core/stdurl/url.cpp +++ b/src/core/stdurl/url.cpp @@ -40,25 +40,22 @@ static INT_PTR ReadUrlCommand(WPARAM, LPARAM lParam) static int UrlEventAdded(WPARAM wParam, LPARAM lParam) { - CLISTEVENT cle; - DBEVENTINFO dbei; - TCHAR szTooltip[256]; - - ZeroMemory(&dbei, sizeof(dbei)); - dbei.cbSize = sizeof(dbei); - dbei.cbBlob = 0; - CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei); - if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL) return 0; + DBEVENTINFO dbei = { sizeof(dbei) }; + db_event_get((HANDLE)lParam, &dbei); + if (dbei.flags&(DBEF_SENT|DBEF_READ) || dbei.eventType != EVENTTYPE_URL) + return 0; SkinPlaySound("RecvUrl"); - ZeroMemory(&cle, sizeof(cle)); - cle.cbSize = sizeof(cle); + + TCHAR szTooltip[256]; + mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName((HANDLE)wParam, 0)); + + CLISTEVENT cle = { sizeof(cle) }; cle.flags = CLEF_TCHAR; cle.hContact = (HANDLE)wParam; cle.hDbEvent = (HANDLE)lParam; cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL); cle.pszService = "SRUrl/ReadUrl"; - mir_sntprintf(szTooltip, SIZEOF(szTooltip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName((HANDLE)wParam, 0)); cle.ptszTooltip = szTooltip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); return 0; @@ -72,31 +69,27 @@ static INT_PTR SendUrlCommand(WPARAM wParam, LPARAM) static void RestoreUnreadUrlAlerts(void) { - CLISTEVENT cle = {0}; - DBEVENTINFO dbei = {0}; - TCHAR toolTip[256]; - HANDLE hDbEvent, hContact; - - dbei.cbSize = sizeof(dbei); - cle.cbSize = sizeof(cle); + CLISTEVENT cle = { sizeof(cle) }; cle.hIcon = LoadSkinIcon(SKINICON_EVENT_URL); cle.pszService = "SRUrl/ReadUrl"; + cle.flags = CLEF_TCHAR; - hContact = db_find_first(); + HANDLE hContact = db_find_first(); while (hContact) { - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD, (WPARAM)hContact, 0); + HANDLE hDbEvent = db_event_firstUnread(hContact); while (hDbEvent) { - dbei.cbBlob = 0; - CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei); + DBEVENTINFO dbei = { sizeof(dbei) }; + db_event_get(hDbEvent, &dbei); if ( !(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType == EVENTTYPE_URL) { + TCHAR toolTip[256]; + mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + cle.hContact = hContact; cle.hDbEvent = hDbEvent; - cle.flags = CLEF_TCHAR; - mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("URL from %s"), pcli->pfnGetContactDisplayName(hContact, 0)); cle.ptszTooltip = toolTip; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDNEXT, (WPARAM)hDbEvent, 0); + hDbEvent = db_event_next(hDbEvent); } hContact = db_find_next(hContact); } -- cgit v1.2.3