From f51995e13679a37851baef8e7f52f2d993cbc7c1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Sep 2016 17:11:58 +0000 Subject: mode old database junk to die git-svn-id: http://svn.miranda-ng.org/main/trunk@17291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewEventNotify/src/main.cpp | 10 ++++------ plugins/NewEventNotify/src/popup.cpp | 23 +++++++---------------- 2 files changed, 11 insertions(+), 22 deletions(-) (limited to 'plugins/NewEventNotify') diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index 85fa3f1e9a..275372ef71 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -70,12 +70,10 @@ int HookedNewEvent(WPARAM hContact, LPARAM hDbEvent) return 0; //custom database event types - if (ServiceExists(MS_DB_EVENT_GETTYPE)) { - DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbe.szModule, (LPARAM)dbe.eventType); - // ignore events according to flags - if (pei && pei->flags & DETF_NONOTIFY) - return 0; - } + DBEVENTTYPEDESCR *pei = DbEvent_GetType(dbe.szModule, dbe.eventType); + // ignore events according to flags + if (pei && pei->flags & DETF_NONOTIFY) + return 0; //if event was allready read don't show it if (pluginOptions.bReadCheck && (dbe.flags & DBEF_READ)) diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 219a65bee2..466cbf0661 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -369,29 +369,20 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei) break; default: - if (ServiceExists(MS_DB_EVENT_GETTYPE)) { - DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType); - // support for custom database event types - if (pei && dbei->pBlob) { - DBEVENTGETTEXT svc = {dbei, DBVT_WCHAR, CP_ACP}; - wchar_t *pet = (wchar_t*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc); - if (pet) { - // we've got event text, move to our memory space - comment1 = mir_wstrdup(pet); - mir_free(pet); - } - commentFix = pei->descr; - } - else commentFix = POPUP_COMMENT_OTHER; + DBEVENTTYPEDESCR *pei = DbEvent_GetType(dbei->szModule, dbei->eventType); + // support for custom database event types + if (pei && dbei->pBlob) { + comment1 = DbEvent_GetTextW(dbei, CP_ACP); + commentFix = pei->descr; } else commentFix = POPUP_COMMENT_OTHER; } - if ( mir_wstrlen(comment1) > 0) { + if (mir_wstrlen(comment1) > 0) { mir_free(comment2); return comment1; } - if ( mir_wstrlen(comment2) > 0) { + if (mir_wstrlen(comment2) > 0) { mir_free(comment1); return comment2; } -- cgit v1.2.3