diff options
-rw-r--r-- | include/m_database.h | 4 | ||||
-rw-r--r-- | include/m_db_int.h | 8 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 204354 -> 204724 bytes | |||
-rw-r--r-- | libs/win32/mir_core.lib | bin | 463890 -> 463890 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 199980 -> 200360 bytes | |||
-rw-r--r-- | libs/win64/mir_core.lib | bin | 468772 -> 468772 bytes | |||
-rw-r--r-- | plugins/Db3x_mmap/src/dbevents.cpp | 4 | ||||
-rw-r--r-- | plugins/Db3x_mmap/src/dbintf.h | 4 | ||||
-rw-r--r-- | plugins/Dbx_mdbx/src/dbevents.cpp | 11 | ||||
-rw-r--r-- | plugins/Dbx_mdbx/src/dbintf.h | 6 | ||||
-rwxr-xr-x | plugins/Dbx_sqlite/src/dbevents.cpp | 4 | ||||
-rwxr-xr-x | plugins/Dbx_sqlite/src/dbintf.h | 4 | ||||
-rw-r--r-- | plugins/Import/src/dbrw/dbevents.cpp | 4 | ||||
-rw-r--r-- | plugins/Import/src/dbrw/dbintf.h | 4 | ||||
-rw-r--r-- | src/mir_app/src/MDatabaseReadonly.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 4 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 4 | ||||
-rw-r--r-- | src/mir_core/src/db.cpp | 4 |
18 files changed, 35 insertions, 34 deletions
diff --git a/include/m_database.h b/include/m_database.h index 0988d2a483..c49ed1a270 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -277,7 +277,7 @@ public: #define EVENTTYPE_AUTHREQUEST 1001 //specific codes, hence the module-
#define EVENTTYPE_FILE 1002 //specific limit has been raised to 2000
-EXTERN_C MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei);
+EXTERN_C MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, const DBEVENTINFO *dbei);
// Gets the number of events in the chain belonging to a contact in the database.
// Returns the number of events in the chain owned by hContact or -1 if hContact
@@ -295,7 +295,7 @@ EXTERN_C MIR_CORE_DLL(int) db_event_delete(MEVENT hDbEvent); // Edits an event in the database
// Returns 0 on success, or nonzero on error
-EXTERN_C MIR_CORE_DLL(int) db_event_edit(MCONTACT hContact, MEVENT hDbEvent, DBEVENTINFO *dbei);
+EXTERN_C MIR_CORE_DLL(int) db_event_edit(MCONTACT hContact, MEVENT hDbEvent, const DBEVENTINFO *dbei);
// Retrieves a handle to the first event in the chain for hContact
// Returns the handle, or NULL if hContact is invalid or has no events
diff --git a/include/m_db_int.h b/include/m_db_int.h index a2a13f3d12..c873609069 100644 --- a/include/m_db_int.h +++ b/include/m_db_int.h @@ -95,9 +95,9 @@ interface MIR_APP_EXPORT MIDatabase STDMETHOD_(LONG, GetContactSize)(void) PURE;
STDMETHOD_(LONG, GetEventCount)(MCONTACT contactID) PURE;
- STDMETHOD_(MEVENT, AddEvent)(MCONTACT contactID, DBEVENTINFO *dbe) PURE;
+ STDMETHOD_(MEVENT, AddEvent)(MCONTACT contactID, const DBEVENTINFO *dbe) PURE;
STDMETHOD_(BOOL, DeleteEvent)(MEVENT hDbEvent) PURE;
- STDMETHOD_(BOOL, EditEvent)(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) PURE;
+ STDMETHOD_(BOOL, EditEvent)(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbe) PURE;
STDMETHOD_(LONG, GetBlobSize)(MEVENT hDbEvent) PURE;
STDMETHOD_(BOOL, GetEvent)(MEVENT hDbEvent, DBEVENTINFO *dbe) PURE;
STDMETHOD_(BOOL, MarkEventRead)(MCONTACT contactID, MEVENT hDbEvent) PURE;
@@ -209,9 +209,9 @@ public: STDMETHODIMP_(LONG) GetContactSize(void) override;
////////////////////////////////////////////////////////////////////////////////////////
- STDMETHODIMP_(MEVENT) AddEvent(MCONTACT, DBEVENTINFO*) override;
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT, const DBEVENTINFO*) override;
STDMETHODIMP_(BOOL) DeleteEvent(MEVENT) override;
- STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe);
+ STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbe) override;
STDMETHODIMP_(LONG) GetBlobSize(MEVENT) override;
STDMETHODIMP_(BOOL) MarkEventRead(MCONTACT, MEVENT) override;
STDMETHODIMP_(MCONTACT) GetEventContact(MEVENT) override;
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex fde19bca4d..3c29c31e24 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib Binary files differindex b63361053a..86c1c63d28 100644 --- a/libs/win32/mir_core.lib +++ b/libs/win32/mir_core.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 51e4fac219..39a656ef22 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib Binary files differindex d84d42a5f8..761a4f7bd5 100644 --- a/libs/win64/mir_core.lib +++ b/libs/win64/mir_core.lib diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index ba17be694e..8e64963ac7 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -30,7 +30,7 @@ LONG CDb3Mmap::GetEventCount(MCONTACT contactID) return (dbc->signature != DBCONTACT_SIGNATURE) ? -1 : dbc->eventCount;
}
-MEVENT CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+MEVENT CDb3Mmap::AddEvent(MCONTACT contactID, const DBEVENTINFO *dbei)
{
if (dbei == nullptr) return 0;
if (dbei->timestamp == 0) return 0;
@@ -260,7 +260,7 @@ BOOL CDb3Mmap::DeleteEvent(MEVENT hDbEvent) return 0;
}
-BOOL CDb3Mmap::EditEvent(MCONTACT, MEVENT, DBEVENTINFO*)
+BOOL CDb3Mmap::EditEvent(MCONTACT, MEVENT, const DBEVENTINFO*)
{
return 1;
}
diff --git a/plugins/Db3x_mmap/src/dbintf.h b/plugins/Db3x_mmap/src/dbintf.h index bdbcbeac0c..97c262f8ce 100644 --- a/plugins/Db3x_mmap/src/dbintf.h +++ b/plugins/Db3x_mmap/src/dbintf.h @@ -218,9 +218,9 @@ public: STDMETHODIMP_(LONG) GetContactSize(void) override;
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override;
- STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override;
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, const DBEVENTINFO *dbe) override;
STDMETHODIMP_(BOOL) DeleteEvent(MEVENT hDbEvent) override;
- STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override;
+ STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, const 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;
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp index 78d1531a29..6a7592a781 100644 --- a/plugins/Dbx_mdbx/src/dbevents.cpp +++ b/plugins/Dbx_mdbx/src/dbevents.cpp @@ -34,7 +34,7 @@ LONG CDbxMDBX::GetEventCount(MCONTACT contactID) ///////////////////////////////////////////////////////////////////////////////
-MEVENT CDbxMDBX::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei)
+MEVENT CDbxMDBX::AddEvent(MCONTACT contactID, const DBEVENTINFO *dbei)
{
if (dbei == nullptr) return 0;
if (dbei->timestamp == 0) return 0;
@@ -127,11 +127,12 @@ BOOL CDbxMDBX::DeleteEvent(MEVENT hDbEvent) ///////////////////////////////////////////////////////////////////////////////
-BOOL CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbei)
+BOOL CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbei)
{
if (dbei == nullptr) return 1;
if (dbei->timestamp == 0) return 1;
+ DBEVENTINFO tmp = *dbei;
{
txn_ptr_ro txn(m_txn_ro);
MDBX_val key = { &hDbEvent, sizeof(MEVENT) }, data;
@@ -139,13 +140,13 @@ BOOL CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbei) return 1;
DBEvent *dbe = (DBEvent*)data.iov_base;
- dbei->timestamp = dbe->timestamp;
+ tmp.timestamp = dbe->timestamp;
}
- return !EditEvent(contactID, hDbEvent, dbei, false);
+ return !EditEvent(contactID, hDbEvent, &tmp, false);
}
-bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbei, bool bNew)
+bool CDbxMDBX::EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbei, bool bNew)
{
DBEvent dbe;
dbe.dwContactID = contactID; // store native or subcontact's id
diff --git a/plugins/Dbx_mdbx/src/dbintf.h b/plugins/Dbx_mdbx/src/dbintf.h index 4a089b8ef3..b74b6bbc12 100644 --- a/plugins/Dbx_mdbx/src/dbintf.h +++ b/plugins/Dbx_mdbx/src/dbintf.h @@ -168,7 +168,7 @@ class CDbxMDBX : public MDatabaseCommon, public MZeroedObject }
bool CheckEvent(DBCachedContact *cc, const DBEvent *dbe, DBCachedContact *&cc2);
- bool EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe, bool bNew);
+ bool EditEvent(MCONTACT contactID, MEVENT hDbEvent, const DBEVENTINFO *dbe, bool bNew);
void FillContacts(void);
int PrepareCheck(void);
void TouchFile(void);
@@ -267,9 +267,9 @@ public: STDMETHODIMP_(LONG) GetContactSize(void) override;
STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override;
- STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override;
+ STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, const DBEVENTINFO *dbe) override;
STDMETHODIMP_(BOOL) DeleteEvent(MEVENT hDbEvent) override;
- STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override;
+ STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, const 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;
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp index ef6562f85a..62de7b8394 100755 --- a/plugins/Dbx_sqlite/src/dbevents.cpp +++ b/plugins/Dbx_sqlite/src/dbevents.cpp @@ -123,7 +123,7 @@ LONG CDbxSQLite::GetEventCount(MCONTACT hContact) return cc->m_count; } -MEVENT CDbxSQLite::AddEvent(MCONTACT hContact, DBEVENTINFO *dbei) +MEVENT CDbxSQLite::AddEvent(MCONTACT hContact, const DBEVENTINFO *dbei) { if (dbei == nullptr) return 0; @@ -245,7 +245,7 @@ BOOL CDbxSQLite::DeleteEvent(MEVENT hDbEvent) return 0; } -BOOL CDbxSQLite::EditEvent(MCONTACT hContact, MEVENT hDbEvent, DBEVENTINFO *dbei) +BOOL CDbxSQLite::EditEvent(MCONTACT hContact, MEVENT hDbEvent, const DBEVENTINFO *dbei) { if (dbei == nullptr) return 1; diff --git a/plugins/Dbx_sqlite/src/dbintf.h b/plugins/Dbx_sqlite/src/dbintf.h index 16a8db11dd..8a2c0f98a7 100755 --- a/plugins/Dbx_sqlite/src/dbintf.h +++ b/plugins/Dbx_sqlite/src/dbintf.h @@ -63,9 +63,9 @@ public: STDMETHODIMP_(LONG) GetContactSize(void) override; STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override; - STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override; + STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, const DBEVENTINFO *dbe) override; STDMETHODIMP_(BOOL) DeleteEvent(MEVENT hDbEvent) override; - STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override; + STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, const 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; diff --git a/plugins/Import/src/dbrw/dbevents.cpp b/plugins/Import/src/dbrw/dbevents.cpp index 0b4611d51d..3dff9584ab 100644 --- a/plugins/Import/src/dbrw/dbevents.cpp +++ b/plugins/Import/src/dbrw/dbevents.cpp @@ -34,7 +34,7 @@ STDMETHODIMP_(LONG) CDbxSQLite::GetEventCount(MCONTACT contactID) return res; } -STDMETHODIMP_(MEVENT) CDbxSQLite::AddEvent(MCONTACT, DBEVENTINFO*) +STDMETHODIMP_(MEVENT) CDbxSQLite::AddEvent(MCONTACT, const DBEVENTINFO*) { return 0; } @@ -44,7 +44,7 @@ STDMETHODIMP_(BOOL) CDbxSQLite::DeleteEvent(MEVENT) return FALSE; } -BOOL CDbxSQLite::EditEvent(MCONTACT, MEVENT, DBEVENTINFO*) +BOOL CDbxSQLite::EditEvent(MCONTACT, MEVENT, const DBEVENTINFO*) { return 1; } diff --git a/plugins/Import/src/dbrw/dbintf.h b/plugins/Import/src/dbrw/dbintf.h index 6d62fd6fb6..09d7514f2f 100644 --- a/plugins/Import/src/dbrw/dbintf.h +++ b/plugins/Import/src/dbrw/dbintf.h @@ -132,9 +132,9 @@ public: STDMETHODIMP_(LONG) GetContactSize(void) override; STDMETHODIMP_(LONG) GetEventCount(MCONTACT contactID) override; - STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, DBEVENTINFO *dbe) override; + STDMETHODIMP_(MEVENT) AddEvent(MCONTACT contactID, const DBEVENTINFO *dbe) override; STDMETHODIMP_(BOOL) DeleteEvent(MEVENT hDbEvent) override; - STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, DBEVENTINFO *dbe) override; + STDMETHODIMP_(BOOL) EditEvent(MCONTACT contactID, MEVENT hDbEvent, const 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; diff --git a/src/mir_app/src/MDatabaseReadonly.cpp b/src/mir_app/src/MDatabaseReadonly.cpp index 51dfcbf3ec..c5ab94fed6 100644 --- a/src/mir_app/src/MDatabaseReadonly.cpp +++ b/src/mir_app/src/MDatabaseReadonly.cpp @@ -66,7 +66,7 @@ LONG MDatabaseReadonly::GetContactSize(void) ///////////////////////////////////////////////////////////////////////////////////////// -MEVENT MDatabaseReadonly::AddEvent(MCONTACT, DBEVENTINFO*) +MEVENT MDatabaseReadonly::AddEvent(MCONTACT, const DBEVENTINFO*) { return 0; } @@ -76,7 +76,7 @@ BOOL MDatabaseReadonly::DeleteEvent(MEVENT) return 1; } -BOOL MDatabaseReadonly::EditEvent(MCONTACT, MEVENT, DBEVENTINFO*) +BOOL MDatabaseReadonly::EditEvent(MCONTACT, MEVENT, const DBEVENTINFO*) { return 1; } diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index ac47bef30c..8ba3de0e9b 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -575,7 +575,7 @@ Menu_SetVisible @662 Miranda_WaitOnHandleEx @663
??1MDatabaseReadonly@@UAE@XZ @664 NONAME
?AddContact@MDatabaseReadonly@@UAGIXZ @665 NONAME
-?AddEvent@MDatabaseReadonly@@UAGIIPAUDBEVENTINFO@@@Z @666 NONAME
+?AddEvent@MDatabaseReadonly@@UAGIIPBUDBEVENTINFO@@@Z @666 NONAME
?DeleteContact@MDatabaseReadonly@@UAGJI@Z @667 NONAME
?DeleteContactSetting@MDatabaseReadonly@@UAGHIPBD0@Z @668 NONAME
?DeleteEvent@MDatabaseReadonly@@UAGHI@Z @669 NONAME
@@ -597,7 +597,7 @@ Miranda_WaitOnHandleEx @663 ??_7MDatabaseReadonly@@6B@ @685 NONAME
?GetEventById@MDatabaseReadonly@@UAGIPBD0@Z @686 NONAME
?SetEventId@MDatabaseReadonly@@UAGHPBDI0@Z @687 NONAME
-?EditEvent@MDatabaseReadonly@@UAGHIIPAUDBEVENTINFO@@@Z @688 NONAME
+?EditEvent@MDatabaseReadonly@@UAGHIIPBUDBEVENTINFO@@@Z @688 NONAME
g_hevContactAdded @689 NONAME
g_hevContactDeleted @690 NONAME
g_hevEventAdded @691 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index b31b5675f9..430ffd6917 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -575,7 +575,7 @@ Menu_SetVisible @662 Miranda_WaitOnHandleEx @663
??1MDatabaseReadonly@@UEAA@XZ @664 NONAME
?AddContact@MDatabaseReadonly@@UEAAIXZ @665 NONAME
-?AddEvent@MDatabaseReadonly@@UEAAIIPEAUDBEVENTINFO@@@Z @666 NONAME
+?AddEvent@MDatabaseReadonly@@UEAAIIPEBUDBEVENTINFO@@@Z @666 NONAME
?DeleteContact@MDatabaseReadonly@@UEAAJI@Z @667 NONAME
?DeleteContactSetting@MDatabaseReadonly@@UEAAHIPEBD0@Z @668 NONAME
?DeleteEvent@MDatabaseReadonly@@UEAAHI@Z @669 NONAME
@@ -597,7 +597,7 @@ Miranda_WaitOnHandleEx @663 ??_7MDatabaseReadonly@@6B@ @685 NONAME
?GetEventById@MDatabaseReadonly@@UEAAIPEBD0@Z @686 NONAME
?SetEventId@MDatabaseReadonly@@UEAAHPEBDI0@Z @687 NONAME
-?EditEvent@MDatabaseReadonly@@UEAAHIIPEAUDBEVENTINFO@@@Z @688 NONAME
+?EditEvent@MDatabaseReadonly@@UEAAHIIPEBUDBEVENTINFO@@@Z @688 NONAME
g_hevContactAdded @689 NONAME
g_hevContactDeleted @690 NONAME
g_hevEventAdded @691 NONAME
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp index 9395366c29..b6b2eba075 100644 --- a/src/mir_core/src/db.cpp +++ b/src/mir_core/src/db.cpp @@ -361,7 +361,7 @@ MIR_CORE_DLL(INT_PTR) db_set_blob(MCONTACT hContact, const char *szModule, const /////////////////////////////////////////////////////////////////////////////////////////
// events
-MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, DBEVENTINFO *dbei)
+MIR_CORE_DLL(MEVENT) db_event_add(MCONTACT hContact, const DBEVENTINFO *dbei)
{
return (currDb == nullptr) ? 0 : currDb->AddEvent(hContact, dbei);
}
@@ -376,7 +376,7 @@ MIR_CORE_DLL(int) db_event_delete(MEVENT hDbEvent) return (currDb == nullptr) ? 0 : currDb->DeleteEvent(hDbEvent);
}
-MIR_CORE_DLL(int) db_event_edit(MCONTACT hContact, MEVENT hDbEvent, DBEVENTINFO *dbei)
+MIR_CORE_DLL(int) db_event_edit(MCONTACT hContact, MEVENT hDbEvent, const DBEVENTINFO *dbei)
{
return (currDb == nullptr) ? 0 : currDb->EditEvent(hContact, hDbEvent, dbei);
}
|