From 3791ce0c509d1d7a64cbba67015db38f4db5404c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 18 Feb 2014 18:37:18 +0000 Subject: - introducing ME_DB_EVENT_MARKED_READ - an event being called upon the call of db_event_markRead; - various m_database.h related code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewEventNotify/src/main.cpp | 2 +- plugins/NewEventNotify/src/popup.cpp | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) (limited to 'plugins/NewEventNotify') diff --git a/plugins/NewEventNotify/src/main.cpp b/plugins/NewEventNotify/src/main.cpp index a100978f0a..7a946b16cf 100644 --- a/plugins/NewEventNotify/src/main.cpp +++ b/plugins/NewEventNotify/src/main.cpp @@ -78,7 +78,7 @@ int HookedNewEvent(WPARAM hContact, LPARAM lParam) 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->cbSize >= DBEVENTTYPEDESCR_SIZE && pei->flags & DETF_NONOTIFY) + if (pei && pei->flags & DETF_NONOTIFY) return 0; } diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp index 3f1ce3646a..d1d196dc9e 100644 --- a/plugins/NewEventNotify/src/popup.cpp +++ b/plugins/NewEventNotify/src/popup.cpp @@ -336,18 +336,15 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei) default: if (ServiceExists(MS_DB_EVENT_GETTYPE)) { - DBEVENTTYPEDESCR* pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType); + DBEVENTTYPEDESCR *pei = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType); // support for custom database event types - if (pei && pei->cbSize >= DBEVENTTYPEDESCR_SIZE_V1) { - // preview requested - if (dbei->pBlob) { - DBEVENTGETTEXT svc = {dbei, DBVT_TCHAR, CP_ACP}; - TCHAR *pet = (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc); - if (pet) { - // we've got event text, move to our memory space - comment1 = mir_tstrdup(pet); - mir_free(pet); - } + if (pei && dbei->pBlob) { + DBEVENTGETTEXT svc = {dbei, DBVT_TCHAR, CP_ACP}; + TCHAR *pet = (TCHAR*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&svc); + if (pet) { + // we've got event text, move to our memory space + comment1 = mir_tstrdup(pet); + mir_free(pet); } commentFix = pei->descr; } -- cgit v1.2.3