diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-23 17:27:04 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-23 17:27:12 +0300 |
commit | 95b66d773710bfdc4784ebac07bbb86868fdea8a (patch) | |
tree | ff053043d665086c1c97ebe331c42974eca52614 /plugins/Db3x_mmap/src | |
parent | e5902c3524be5c1473563521c3e6e99acdf3ec3c (diff) |
db_event_edit - new stub for editing messages
Diffstat (limited to 'plugins/Db3x_mmap/src')
-rw-r--r-- | plugins/Db3x_mmap/src/dbevents.cpp | 29 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 1 |
2 files changed, 18 insertions, 12 deletions
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 34a0ae2d3f..3f6d575329 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -23,14 +23,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
-STDMETHODIMP_(LONG) CDb3Mmap::GetEventCount(MCONTACT contactID)
+LONG CDb3Mmap::GetEventCount(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
DBContact *dbc = (DBContact*)DBRead(GetContactOffset(contactID), nullptr);
return (dbc->signature != DBCONTACT_SIGNATURE) ? -1 : dbc->eventCount;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+MEVENT CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
{
if (dbei == nullptr) return 0;
if (dbei->timestamp == 0) return 0;
@@ -162,7 +162,7 @@ STDMETHODIMP_(MEVENT) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) return (MEVENT)ofsNew;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
+BOOL CDb3Mmap::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -257,14 +257,19 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteEvent(MCONTACT contactID, MEVENT hDbEvent) return 0;
}
-STDMETHODIMP_(LONG) CDb3Mmap::GetBlobSize(MEVENT hDbEvent)
+BOOL CDb3Mmap::EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe)
+{
+ return 1;
+}
+
+LONG CDb3Mmap::GetBlobSize(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, 0);
return (dbe->signature != DBEVENT_SIGNATURE) ? -1 : dbe->cbBlob;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
+BOOL CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei)
{
if (dbei == nullptr) return 1;
if (dbei->cbBlob > 0 && dbei->pBlob == nullptr) {
@@ -306,7 +311,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbei) return 0;
}
-STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
+BOOL CDb3Mmap::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc;
if (contactID) {
@@ -356,14 +361,14 @@ STDMETHODIMP_(BOOL) CDb3Mmap::MarkEventRead(MCONTACT contactID, MEVENT hDbEvent) return ret;
}
-STDMETHODIMP_(MCONTACT) CDb3Mmap::GetEventContact(MEVENT hDbEvent)
+MCONTACT CDb3Mmap::GetEventContact(MEVENT hDbEvent)
{
mir_cslock lck(m_csDbAccess);
DBEvent *dbe = AdaptEvent((DWORD)hDbEvent, INVALID_CONTACT_ID);
return (dbe->signature != DBEVENT_SIGNATURE) ? INVALID_CONTACT_ID : dbe->contactID;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstEvent(MCONTACT contactID)
+MEVENT CDb3Mmap::FindFirstEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -392,7 +397,7 @@ STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstEvent(MCONTACT contactID) return 0;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
+MEVENT CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -421,7 +426,7 @@ STDMETHODIMP_(MEVENT) CDb3Mmap::FindFirstUnreadEvent(MCONTACT contactID) return 0;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::FindLastEvent(MCONTACT contactID)
+MEVENT CDb3Mmap::FindLastEvent(MCONTACT contactID)
{
DBCachedContact *cc;
DWORD ofsContact = GetContactOffset(contactID, &cc);
@@ -450,7 +455,7 @@ STDMETHODIMP_(MEVENT) CDb3Mmap::FindLastEvent(MCONTACT contactID) return 0;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
+MEVENT CDb3Mmap::FindNextEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : nullptr;
@@ -472,7 +477,7 @@ STDMETHODIMP_(MEVENT) CDb3Mmap::FindNextEvent(MCONTACT contactID, MEVENT hDbEven return 0;
}
-STDMETHODIMP_(MEVENT) CDb3Mmap::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
+MEVENT CDb3Mmap::FindPrevEvent(MCONTACT contactID, MEVENT hDbEvent)
{
DBCachedContact *cc = (contactID) ? m_cache->GetCachedContact(contactID) : nullptr;
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index 8f5970ff99..c00c6d8321 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -220,6 +220,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) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override;
STDMETHODIMP_(LONG) GetBlobSize(MEVENT hDbEvent) override;
STDMETHODIMP_(BOOL) GetEvent(MEVENT hDbEvent, DBEVENTINFO *dbe) override;
STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT contactID, MEVENT hDbEvent) override;
|