diff options
Diffstat (limited to 'plugins/Dbx_sqlite/src')
-rwxr-xr-x | plugins/Dbx_sqlite/src/dbevents.cpp | 10 | ||||
-rwxr-xr-x | plugins/Dbx_sqlite/src/dbintf.h | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index 77aee3f4e4..ef6562f85a 100755 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -207,14 +207,13 @@ MEVENT CDbxSQLite::AddEvent(MCONTACT hContact, DBEVENTINFO *dbei) return hDbEvent; } -BOOL CDbxSQLite::DeleteEvent(MCONTACT hContact, MEVENT hDbEvent) +BOOL CDbxSQLite::DeleteEvent(MEVENT hDbEvent) { if (hDbEvent == 0) return 1; - DBCachedContact *cc = (hContact) - ? m_cache->GetCachedContact(hContact) - : &m_system; + MEVENT hContact = GetEventContact(hDbEvent); + DBCachedContact *cc = (hContact) ? m_cache->GetCachedContact(hContact) : &m_system; if (cc == nullptr) return 1; @@ -236,13 +235,12 @@ BOOL CDbxSQLite::DeleteEvent(MCONTACT hContact, MEVENT hDbEvent) if (rc != SQLITE_DONE) return 1; - cc->DeleteEvent(hDbEvent); if (cc->IsSub() && (cc = m_cache->GetCachedContact(cc->parentID))) cc->DeleteEvent(hDbEvent); } - NotifyEventHooks(g_hevEventDeleted, hContact, (LPARAM)hDbEvent); + NotifyEventHooks(g_hevEventDeleted, hContact, hDbEvent); return 0; } diff --git a/plugins/Dbx_sqlite/src/dbintf.h b/plugins/Dbx_sqlite/src/dbintf.h index fdab9d8b4c..16a8db11dd 100755 --- a/plugins/Dbx_sqlite/src/dbintf.h +++ b/plugins/Dbx_sqlite/src/dbintf.h @@ -64,7 +64,7 @@ public: STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override; STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override; - STDMETHODIMP_(BOOL) DeleteEvent(MCONTACT contactID, MEVENT hDbEvent) override; + STDMETHODIMP_(BOOL) DeleteEvent(MEVENT hDbEvent) override; STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override; STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent) override; STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe) override; |