From ffed014ccd5370a5073594d55dd0dc88080e0b3d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 18 Jan 2015 18:55:32 +0000 Subject: contacts cache details to be completely hidden from the outside world git-svn-id: http://svn.miranda-ng.org/main/trunk@11873 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbcontacts.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp') diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp index cf13a782b9..14267ab9ff 100644 --- a/plugins/Dbx_mdb/src/dbcontacts.cpp +++ b/plugins/Dbx_mdb/src/dbcontacts.cpp @@ -46,6 +46,11 @@ STDMETHODIMP_(LONG) CDbxMdb::GetContactCount(void) return m_contactCount; } +STDMETHODIMP_(LONG) CDbxMdb::GetContactSize(void) +{ + return sizeof(DBCachedContact); +} + STDMETHODIMP_(MCONTACT) CDbxMdb::FindFirstContact(const char *szProto) { mir_cslock lck(m_csDbAccess); @@ -102,9 +107,8 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::AddContact() { DWORD dwContactId; - DBContact dbc; + DBContact dbc = { 0 }; dbc.signature = DBCONTACT_SIGNATURE; - dbc.eventCount = 0; { mir_cslock lck(m_csDbAccess); dwContactId = m_dwMaxContactId++; @@ -119,8 +123,7 @@ STDMETHODIMP_(MCONTACT) CDbxMdb::AddContact() break; } - DBCachedContact *cc = m_cache->AddContactToCache(dwContactId); - cc->dwDriverData = 0; + m_cache->AddContactToCache(dwContactId); } NotifyEventHooks(hContactAddedEvent, dwContactId, 0); @@ -185,7 +188,9 @@ void CDbxMdb::FillContacts() DatabaseCorruption(NULL); DBCachedContact *cc = m_cache->AddContactToCache(*(DWORD*)key.mv_data); - cc->dwDriverData = dbc->eventCount; + cc->dwEventCount = dbc->eventCount; + cc->dwFirstUnread = dbc->dwFirstUnread; + cc->tsFirstUnread = dbc->tsFirstUnread; arContacts.insert(cc); } } -- cgit v1.2.3