summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_database.h114
-rw-r--r--include/m_db_int.h6
-rw-r--r--include/m_system.h5
-rw-r--r--libs/win32/mir_app.libbin204994 -> 206020 bytes
-rw-r--r--libs/win32/mir_core.libbin463890 -> 466504 bytes
-rw-r--r--libs/win64/mir_app.libbin200606 -> 201662 bytes
-rw-r--r--libs/win64/mir_core.libbin468772 -> 471444 bytes
-rw-r--r--plugins/FTPFileYM/src/mir_db.h21
-rw-r--r--plugins/NewEventNotify/src/popup.cpp2
-rw-r--r--protocols/Discord/src/utils.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_misc.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_contacts.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp2
-rw-r--r--protocols/Steam/src/steam_contacts.cpp2
-rw-r--r--protocols/Tox/src/tox_contacts.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp2
-rw-r--r--src/mir_app/src/MDatabaseCommon.cpp13
-rw-r--r--src/mir_app/src/db_events.cpp10
-rw-r--r--src/mir_app/src/mir_app.def34
-rw-r--r--src/mir_app/src/mir_app64.def34
-rw-r--r--src/mir_core/src/db.cpp10
-rw-r--r--src/mir_core/src/mir_core.def8
-rw-r--r--src/mir_core/src/mir_core64.def8
24 files changed, 190 insertions, 93 deletions
diff --git a/include/m_database.h b/include/m_database.h
index f9ef17b29d..7c85348659 100644
--- a/include/m_database.h
+++ b/include/m_database.h
@@ -173,27 +173,22 @@ struct DBEVENTINFO
DWORD timestamp; // seconds since 00:00, 01/01/1970. Gives us times until 2106
// unless you use the standard C library which is
// signed and can only do until 2038. In GMT.
- DWORD flags; // the omnipresent flags
+ DWORD flags; // combination of DBEF_* flags
WORD eventType; // module-defined event type field
DWORD cbBlob; // size of pBlob in bytes
PBYTE pBlob; // pointer to buffer containing module-defined event data
-#if defined(__cplusplus)
- bool __forceinline markedRead() const
- {
+ bool __forceinline markedRead() const {
return (flags & (DBEF_SENT | DBEF_READ)) != 0;
}
- wchar_t* getString(const char *str) const
- {
+ wchar_t* getString(const char *str) const {
return (flags & DBEF_UTF) ? mir_utf8decodeW(str) : mir_a2u(str);
}
- bool __forceinline operator==(const DBEVENTINFO &e)
- {
+ bool __forceinline operator==(const DBEVENTINFO &e) {
return (timestamp == e.timestamp && eventType == e.eventType && cbBlob == e.cbBlob && (flags & DBEF_SENT) == (e.flags & DBEF_SENT));
}
- #endif
};
EXTERN_C MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv);
@@ -207,11 +202,7 @@ EXTERN_C MIR_CORE_DLL(INT_PTR) db_free(DBVARIANT *dbv);
// Returns a handle to the first contact in the db on success, or NULL if there
// are no contacts in the db.
-#if defined(__cplusplus)
EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_first(const char *szProto = nullptr);
-#else
-EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_first(const char *szProto);
-#endif
// Gets the handle of the next contact after hContact in the database. This handle
// can be used with loads of functions. It does not need to be closed.
@@ -219,13 +210,8 @@ EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_first(const char *szProto);
// Returns a handle to the contact after hContact in the db on success or NULL if
// hContact was the last contact in the db or hContact was invalid.
-#if defined(__cplusplus)
EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_next(MCONTACT hContact, const char *szProto = nullptr);
-#else
-EXTERN_C MIR_CORE_DLL(MCONTACT) db_find_next(MCONTACT hContact, const char *szProto);
-#endif
-#if defined(__cplusplus)
class Contacts
{
const char *m_szModule;
@@ -254,7 +240,6 @@ public:
__inline iterator begin() const { return iterator(m_szModule, ::db_find_first(m_szModule)); }
__inline iterator end() const { return iterator(m_szModule, 0); }
};
-#endif
/////////////////////////////////////////////////////////////////////////////////////////
// Database events
@@ -452,19 +437,19 @@ bool Profile_GetSetting(const wchar_t *pwszSetting, wchar_t(&pwszBuf)[_Size], co
/////////////////////////////////////////////////////////////////////////////////////////
// Contact services
-typedef struct {
- const char *szModule; // pointer to name of the module that wrote the
- // setting to get
+struct DBCONTACTGETSETTING
+{
+ const char *szModule; // pointer to name of the module that wrote the setting to get
const char *szSetting; // pointer to name of the setting to get
DBVARIANT *pValue; // pointer to variant to receive the value
-} DBCONTACTGETSETTING;
+};
-typedef struct {
- const char *szModule; // pointer to name of the module that wrote the
- // setting to get
+struct DBCONTACTWRITESETTING
+{
+ const char *szModule; // pointer to name of the module that wrote the setting to get
const char *szSetting; // pointer to name of the setting to get
DBVARIANT value; // variant containing the value to set
-} DBCONTACTWRITESETTING;
+};
/////////////////////////////////////////////////////////////////////////////////////////
// Event services
@@ -675,14 +660,16 @@ __inline DWORD DBGetContactSettingRangedDword(MCONTACT hContact, const char *szM
#endif
+namespace DB
+{
+
/////////////////////////////////////////////////////////////////////////////////////////
// Helper to process the auth req body
-
-///////////////////////////////////////////////////////////////////////////////////////// blob is: 0(DWORD), hContact(DWORD), nick(UTF8), firstName(UTF8), lastName(UTF8), email(UTF8), reason(UTF8) */
+// blob is: 0(DWORD), hContact(DWORD), nick(UTF8), firstName(UTF8), lastName(UTF8), email(UTF8), reason(UTF8)
#pragma warning(disable : 4251)
-class MIR_APP_EXPORT DB_AUTH_BLOB
+class MIR_APP_EXPORT AUTH_BLOB
{
MCONTACT m_hContact;
DWORD m_dwUin;
@@ -692,9 +679,9 @@ class MIR_APP_EXPORT DB_AUTH_BLOB
PBYTE makeBlob();
public:
- explicit DB_AUTH_BLOB(MCONTACT hContact, const char *nick, const char *fname, const char *lname, const char *id, const char *reason);
- explicit DB_AUTH_BLOB(PBYTE blob);
- ~DB_AUTH_BLOB();
+ explicit AUTH_BLOB(MCONTACT hContact, const char *nick, const char *fname, const char *lname, const char *id, const char *reason);
+ explicit AUTH_BLOB(PBYTE blob);
+ ~AUTH_BLOB();
__forceinline operator char*() { return (char*)makeBlob(); }
__forceinline operator BYTE*() { return makeBlob(); }
@@ -712,4 +699,65 @@ public:
__forceinline void set_uin(DWORD dwValue) { m_dwUin = dwValue; }
};
+/////////////////////////////////////////////////////////////////////////////////////////
+// Event cursors
+
+class MIR_CORE_EXPORT EventCursorBase : public MZeroedObject
+{
+ friend class EventIterator;
+
+protected:
+ DBEVENTINFO &dbei;
+ MCONTACT hContact;
+
+ virtual MEVENT FetchNext() = 0;
+
+public:
+ EventCursorBase(MCONTACT _1, DBEVENTINFO &_2) :
+ hContact(_1),
+ dbei(_2)
+ { }
+
+ __forceinline MEVENT begin() {
+ return FetchNext();
+ }
+
+ __forceinline MEVENT end() {
+ return 0;
+ }
+};
+
+#if !defined(CUSTOM_EVENT_CURSOR)
+typedef class EventCursorBase EventCursor;
+#endif
+
+class EventIterator
+{
+ EventCursorBase *cursor;
+ MEVENT hCurr;
+
+public:
+ EventIterator(EventCursorBase *_1) :
+ cursor(_1)
+ {}
+
+ EventIterator operator++() {
+ hCurr = cursor->FetchNext();
+ return *this;
+ }
+
+ bool operator!=(const EventIterator &p) {
+ return hCurr != p.hCurr;
+ }
+
+ operator MEVENT() const {
+ return hCurr;
+ }
+};
+
+MIR_CORE_DLL(EventCursor*) Events(MCONTACT, DBEVENTINFO &);
+MIR_CORE_DLL(EventCursor*) EventsRev(MCONTACT, DBEVENTINFO &);
+
+};
+
#endif // M_DATABASE_H__
diff --git a/include/m_db_int.h b/include/m_db_int.h
index c873609069..bf9823484c 100644
--- a/include/m_db_int.h
+++ b/include/m_db_int.h
@@ -133,6 +133,9 @@ interface MIR_APP_EXPORT MIDatabase
STDMETHOD_(MEVENT, GetEventById)(LPCSTR szModule, LPCSTR szId) PURE;
STDMETHOD_(BOOL, SetEventId)(LPCSTR szModule, MEVENT, LPCSTR szId) PURE;
+
+ STDMETHOD_(DB::EventCursor*, EventCursor)(MCONTACT hContact, DBEVENTINFO &dbei) PURE;
+ STDMETHOD_(DB::EventCursor*, EventCursorRev)(MCONTACT hContact, DBEVENTINFO &dbei) PURE;
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -184,6 +187,9 @@ public:
STDMETHODIMP_(BOOL) Compact(void) override;
STDMETHODIMP_(BOOL) Backup(LPCWSTR) override;
+
+ STDMETHODIMP_(DB::EventCursor*) EventCursor(MCONTACT hContact, DBEVENTINFO &dbei) override;
+ STDMETHODIMP_(DB::EventCursor*) EventCursorRev(MCONTACT hContact, DBEVENTINFO &dbei) override;
};
#pragma warning(pop)
diff --git a/include/m_system.h b/include/m_system.h
index 39477b4d84..c48b1fcc13 100644
--- a/include/m_system.h
+++ b/include/m_system.h
@@ -338,7 +338,7 @@ template<class T> struct LIST
};
__inline void destroy(void) { List_Destroy((SortedList *)this); }
- __inline T *find(T *p) const { return (T *)List_Find((SortedList *)this, p); }
+ __inline T* find(T *p) const { return (T *)List_Find((SortedList *)this, p); }
__inline int indexOf(T *p) const { return List_IndexOf((SortedList *)this, p); }
__inline int insert(T *p, int idx) { return List_Insert((SortedList *)this, p, idx); }
__inline int remove(int idx) { return List_Remove((SortedList *)this, idx); }
@@ -347,7 +347,8 @@ template<class T> struct LIST
__inline int remove(T *p) { return List_RemovePtr((SortedList *)this, p); }
__inline int indexOf(T **p) const { return int(p - items); }
- __inline T *removeItem(T **p)
+
+ __inline T* removeItem(T **p)
{
T *savePtr = *p;
List_Remove((SortedList *)this, int(p - items));
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index fd30ca678c..964fb0a997 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win32/mir_core.lib b/libs/win32/mir_core.lib
index 86c1c63d28..bb12c1ed93 100644
--- a/libs/win32/mir_core.lib
+++ b/libs/win32/mir_core.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index 47bac6ba03..b483807a56 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_core.lib b/libs/win64/mir_core.lib
index 761a4f7bd5..9cca412287 100644
--- a/libs/win64/mir_core.lib
+++ b/libs/win64/mir_core.lib
Binary files differ
diff --git a/plugins/FTPFileYM/src/mir_db.h b/plugins/FTPFileYM/src/mir_db.h
index bc92bd1e15..7293c145ff 100644
--- a/plugins/FTPFileYM/src/mir_db.h
+++ b/plugins/FTPFileYM/src/mir_db.h
@@ -20,19 +20,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
-class DB
+namespace DB
{
-public:
- static int setByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
+ int setByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
+ int setWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
+ int setDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iValue);
- static int setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue);
- static int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue);
+ int setAStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, char *szValue);
+ int setStringF(MCONTACT hContact, char *szModule, char *szSetting, int id, wchar_t *stzValue);
- static int getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
- static int getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
- static int getDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ int getByteF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ int getWordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
+ int getDwordF(MCONTACT hContact, char *szModule, char *szSetting, int id, int iErrorValue = -1);
- static int deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id);
+ int deleteSettingF(MCONTACT hContact, char *szModule, char *szSetting, int id);
};
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index 0cc9bf7df2..07a074042e 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -272,7 +272,7 @@ static wchar_t* GetEventPreview(DBEVENTINFO *dbei)
case EVENTTYPE_AUTHREQUEST:
if (dbei->pBlob) {
- DB_AUTH_BLOB blob(dbei->pBlob);
+ DB::AUTH_BLOB blob(dbei->pBlob);
wchar_t *szNick = nullptr;
if (blob.get_nick())
diff --git a/protocols/Discord/src/utils.cpp b/protocols/Discord/src/utils.cpp
index d2b8f701d3..eac8d02a2b 100644
--- a/protocols/Discord/src/utils.cpp
+++ b/protocols/Discord/src/utils.cpp
@@ -315,7 +315,7 @@ void CDiscordProto::ProcessType(CDiscordUser *pUser, const JSONNode &pRoot)
setByte(pUser->hContact, DB_KEY_REQAUTH, 1);
CMStringA szId(FORMAT, "%lld", pUser->id);
- DB_AUTH_BLOB blob(pUser->hContact, T2Utf(pUser->wszUsername), nullptr, nullptr, szId, nullptr);
+ DB::AUTH_BLOB blob(pUser->hContact, T2Utf(pUser->wszUsername), nullptr, nullptr, szId, nullptr);
PROTORECVEVENT pre = { 0 };
pre.timestamp = (DWORD)time(0);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 1fd7302e72..9b2539fddc 100755
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -48,7 +48,7 @@ void CJabberProto::DBAddAuthRequest(const char *jid, const char *nick)
MCONTACT hContact = DBCreateContact(jid, nick, true, true);
Contact_Hide(hContact, false);
- DB_AUTH_BLOB blob(hContact, nick, nullptr, nullptr, jid, nullptr);
+ DB::AUTH_BLOB blob(hContact, nick, nullptr, nullptr, jid, nullptr);
PROTORECVEVENT pre = {};
pre.timestamp = (DWORD)time(0);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index edee15ae30..fe623c111f 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -388,7 +388,7 @@ MCONTACT CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEVENT hDbE
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
return 0;
- DB_AUTH_BLOB blob(dbei.pBlob);
+ DB::AUTH_BLOB blob(dbei.pBlob);
return AddToListByJID(blob.get_email(), flags);
}
@@ -412,7 +412,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
if (mir_strcmp(dbei.szModule, m_szModuleName))
return 1;
- DB_AUTH_BLOB blob(dbei.pBlob);
+ DB::AUTH_BLOB blob(dbei.pBlob);
debugLogA("Send 'authorization allowed' to %s", blob.get_email());
m_ThreadInfo->send(XmlNode("presence") << XATTR("to", blob.get_email()) << XATTR("type", "subscribed"));
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp
index 22f0b2185d..5500ba5ba2 100644
--- a/protocols/SkypeWeb/src/skype_contacts.cpp
+++ b/protocols/SkypeWeb/src/skype_contacts.cpp
@@ -111,7 +111,7 @@ void CSkypeProto::LoadContactsAuth(const NETLIBHTTPREQUEST *response)
db_set_dw(hContact, m_szModuleName, "LastAuthRequestTime", eventTime);
delSetting(hContact, "Auth");
- DB_AUTH_BLOB blob(hContact, nullptr, nullptr, nullptr, skypename.c_str(), reason.c_str());
+ DB::AUTH_BLOB blob(hContact, nullptr, nullptr, nullptr, skypename.c_str(), reason.c_str());
PROTORECVEVENT pre = { 0 };
pre.timestamp = time(0);
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 84b7a1a337..7faf918ee3 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -174,7 +174,7 @@ MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT hDbEvent)
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
return NULL;
- DB_AUTH_BLOB blob(dbei.pBlob);
+ DB::AUTH_BLOB blob(dbei.pBlob);
MCONTACT hContact = AddContact(blob.get_email());
return hContact;
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index 38b20bc573..ea2b121601 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -308,7 +308,7 @@ void CSteamProto::ContactIsAskingAuth(MCONTACT hContact)
char reason[MAX_PATH];
mir_snprintf(reason, Translate("%s has added you to contact list"), nickName.get());
- DB_AUTH_BLOB blob(hContact, nickName, firstName, lastName, steamId, reason);
+ DB::AUTH_BLOB blob(hContact, nickName, firstName, lastName, steamId, reason);
PROTORECVEVENT recv = { 0 };
recv.timestamp = now();
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp
index ca6de59f40..d64f430891 100644
--- a/protocols/Tox/src/tox_contacts.cpp
+++ b/protocols/Tox/src/tox_contacts.cpp
@@ -230,7 +230,7 @@ void CToxProto::OnFriendRequest(Tox*, const uint8_t *pubKey, const uint8_t *mess
proto->delSetting(hContact, "Auth");
- DB_AUTH_BLOB blob(hContact, nullptr, nullptr, nullptr, (LPCSTR)address, (LPCSTR)message);
+ DB::AUTH_BLOB blob(hContact, nullptr, nullptr, nullptr, (LPCSTR)address, (LPCSTR)message);
PROTORECVEVENT pre = { 0 };
pre.timestamp = now();
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index d8fa035b10..e5acc0d84f 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -589,7 +589,7 @@ void CVkProto::DBAddAuthRequest(const MCONTACT hContact, bool added)
{
debugLogA("CVkProto::DBAddAuthRequest");
- DB_AUTH_BLOB blob(hContact,
+ DB::AUTH_BLOB blob(hContact,
T2Utf(ptrW(db_get_wsa(hContact, m_szModuleName, "Nick"))),
T2Utf(ptrW(db_get_wsa(hContact, m_szModuleName, "FirstName"))),
T2Utf(ptrW(db_get_wsa(hContact, m_szModuleName, "LastName"))), nullptr, nullptr);
diff --git a/src/mir_app/src/MDatabaseCommon.cpp b/src/mir_app/src/MDatabaseCommon.cpp
index 72c69662ce..1e768ffa5f 100644
--- a/src/mir_app/src/MDatabaseCommon.cpp
+++ b/src/mir_app/src/MDatabaseCommon.cpp
@@ -353,3 +353,16 @@ STDMETHODIMP_(BOOL) MDatabaseCommon::SetSettingResident(BOOL bIsResident, const
return 0;
}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Event cursors
+
+STDMETHODIMP_(DB::EventCursor *) MDatabaseCommon::EventCursor(MCONTACT, DBEVENTINFO &)
+{
+ return nullptr;
+}
+
+STDMETHODIMP_(DB::EventCursor *) MDatabaseCommon::EventCursorRev(MCONTACT, DBEVENTINFO &)
+{
+ return nullptr;
+}
diff --git a/src/mir_app/src/db_events.cpp b/src/mir_app/src/db_events.cpp
index d1be5e3276..3776f8c029 100644
--- a/src/mir_app/src/db_events.cpp
+++ b/src/mir_app/src/db_events.cpp
@@ -111,7 +111,7 @@ static INT_PTR DbEventGetTextWorker(DBEVENTINFO *dbei, int codepage, int datatyp
return 0;
if (dbei->eventType == EVENTTYPE_AUTHREQUEST || dbei->eventType == EVENTTYPE_ADDED) {
- DB_AUTH_BLOB blob(dbei->pBlob);
+ DB::AUTH_BLOB blob(dbei->pBlob);
ptrW tszNick(dbei->getString(blob.get_nick()));
ptrW tszFirst(dbei->getString(blob.get_firstName()));
@@ -263,7 +263,7 @@ MIR_APP_DLL(wchar_t*) DbEvent_GetString(DBEVENTINFO *dbei, const char *str)
/////////////////////////////////////////////////////////////////////////////////////////
-DB_AUTH_BLOB::DB_AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR lname, LPCSTR email, LPCSTR reason) :
+DB::AUTH_BLOB::AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR lname, LPCSTR email, LPCSTR reason) :
m_dwUin(0),
m_hContact(hContact),
m_szNick(mir_strdup(nick)),
@@ -275,7 +275,7 @@ DB_AUTH_BLOB::DB_AUTH_BLOB(MCONTACT hContact, LPCSTR nick, LPCSTR fname, LPCSTR
m_size = DWORD(sizeof(DWORD) * 2 + 5 + mir_strlen(m_szNick) + mir_strlen(m_szFirstName) + mir_strlen(m_szLastName) + mir_strlen(m_szEmail) + mir_strlen(m_szReason));
}
-DB_AUTH_BLOB::DB_AUTH_BLOB(PBYTE blob)
+DB::AUTH_BLOB::AUTH_BLOB(PBYTE blob)
{
PBYTE pCurBlob = blob;
m_dwUin = *(PDWORD)pCurBlob;
@@ -290,11 +290,11 @@ DB_AUTH_BLOB::DB_AUTH_BLOB(PBYTE blob)
m_size = DWORD(pCurBlob - blob);
}
-DB_AUTH_BLOB::~DB_AUTH_BLOB()
+DB::AUTH_BLOB::~AUTH_BLOB()
{
}
-PBYTE DB_AUTH_BLOB::makeBlob()
+PBYTE DB::AUTH_BLOB::makeBlob()
{
PBYTE pBlob, pCurBlob;
pCurBlob = pBlob = (PBYTE)mir_alloc(m_size + 1);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 2178f81f32..200a784b75 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -311,25 +311,25 @@ Netlib_SetHttpProxyInfo @380
Netlib_DestroySecurityProvider @381
Netlib_InitSecurityProvider @382
Netlib_NtlmCreateResponse @383
-??0DB_AUTH_BLOB@@QAE@IPBD0000@Z @384 NONAME
-??0DB_AUTH_BLOB@@QAE@PAE@Z @385 NONAME
-??1DB_AUTH_BLOB@@QAE@XZ @386 NONAME
-??4DB_AUTH_BLOB@@QAEAAV0@ABV0@@Z @387 NONAME
-??BDB_AUTH_BLOB@@QAEPADXZ @388 NONAME
-??BDB_AUTH_BLOB@@QAEPAEXZ @389 NONAME
-?get_contact@DB_AUTH_BLOB@@QBEIXZ @390 NONAME
-?get_email@DB_AUTH_BLOB@@QBEPBDXZ @391 NONAME
-?get_firstName@DB_AUTH_BLOB@@QBEPBDXZ @392 NONAME
-?get_lastName@DB_AUTH_BLOB@@QBEPBDXZ @393 NONAME
-?get_nick@DB_AUTH_BLOB@@QBEPBDXZ @394 NONAME
-?get_reason@DB_AUTH_BLOB@@QBEPBDXZ @395 NONAME
-?get_uin@DB_AUTH_BLOB@@QBEKXZ @396 NONAME
-?makeBlob@DB_AUTH_BLOB@@AAEPAEXZ @397 NONAME
-?size@DB_AUTH_BLOB@@QBEKXZ @398 NONAME
+??0AUTH_BLOB@DB@@QAE@IPBD0000@Z @384 NONAME
+??0AUTH_BLOB@DB@@QAE@PAE@Z @385 NONAME
+??1AUTH_BLOB@DB@@QAE@XZ @386 NONAME
+??4AUTH_BLOB@DB@@QAEAAV01@ABV01@@Z @387 NONAME
+??BAUTH_BLOB@DB@@QAEPADXZ @388 NONAME
+??BAUTH_BLOB@DB@@QAEPAEXZ @389 NONAME
+?get_contact@AUTH_BLOB@DB@@QBEIXZ @390 NONAME
+?get_email@AUTH_BLOB@DB@@QBEPBDXZ @391 NONAME
+?get_firstName@AUTH_BLOB@DB@@QBEPBDXZ @392 NONAME
+?get_lastName@AUTH_BLOB@DB@@QBEPBDXZ @393 NONAME
+?get_nick@AUTH_BLOB@DB@@QBEPBDXZ @394 NONAME
+?get_reason@AUTH_BLOB@DB@@QBEPBDXZ @395 NONAME
+?get_uin@AUTH_BLOB@DB@@QBEKXZ @396 NONAME
+?makeBlob@AUTH_BLOB@DB@@AAEPAEXZ @397 NONAME
+?size@AUTH_BLOB@DB@@QBEKXZ @398 NONAME
Chat_UnescapeTags @399 NONAME
ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
-?set_uin@DB_AUTH_BLOB@@QAEXK@Z @402 NONAME
+?set_uin@AUTH_BLOB@DB@@QAEXK@Z @402 NONAME
??0CSrmmBaseDialog@@IAE@AAVCMPluginBase@@HPAUSESSION_INFO@@@Z @403 NONAME
Miranda_GetSystemWindow @404 NONAME
??1CSrmmBaseDialog@@UAE@XZ @405 NONAME
@@ -732,3 +732,5 @@ ProtoBroadcastAsync @814 NONAME
?UseGroups@Clist@@3V?$CMOption@_N@@A @819 NONAME
?OfflineModes@Clist@@3V?$CMOption@K@@A @820 NONAME
?getChat@CSrmmBaseDialog@@QBEPAUSESSION_INFO@@XZ @821 NONAME
+?EventCursor@MDatabaseCommon@@UAGPAVEventCursorBase@DB@@IAAUDBEVENTINFO@@@Z @822 NONAME
+?EventCursorRev@MDatabaseCommon@@UAGPAVEventCursorBase@DB@@IAAUDBEVENTINFO@@@Z @823 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 8fd8b69cbe..50105e6a82 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -311,25 +311,25 @@ Netlib_SetHttpProxyInfo @380
Netlib_DestroySecurityProvider @381
Netlib_InitSecurityProvider @382
Netlib_NtlmCreateResponse @383
-??0DB_AUTH_BLOB@@QEAA@IPEBD0000@Z @384 NONAME
-??0DB_AUTH_BLOB@@QEAA@PEAE@Z @385 NONAME
-??1DB_AUTH_BLOB@@QEAA@XZ @386 NONAME
-??4DB_AUTH_BLOB@@QEAAAEAV0@AEBV0@@Z @387 NONAME
-??BDB_AUTH_BLOB@@QEAAPEADXZ @388 NONAME
-??BDB_AUTH_BLOB@@QEAAPEAEXZ @389 NONAME
-?get_contact@DB_AUTH_BLOB@@QEBAIXZ @390 NONAME
-?get_email@DB_AUTH_BLOB@@QEBAPEBDXZ @391 NONAME
-?get_firstName@DB_AUTH_BLOB@@QEBAPEBDXZ @392 NONAME
-?get_lastName@DB_AUTH_BLOB@@QEBAPEBDXZ @393 NONAME
-?get_nick@DB_AUTH_BLOB@@QEBAPEBDXZ @394 NONAME
-?get_reason@DB_AUTH_BLOB@@QEBAPEBDXZ @395 NONAME
-?get_uin@DB_AUTH_BLOB@@QEBAKXZ @396 NONAME
-?makeBlob@DB_AUTH_BLOB@@AEAAPEAEXZ @397 NONAME
-?size@DB_AUTH_BLOB@@QEBAKXZ @398 NONAME
+??0AUTH_BLOB@DB@@QEAA@IPEBD0000@Z @384 NONAME
+??0AUTH_BLOB@DB@@QEAA@PEAE@Z @385 NONAME
+??1AUTH_BLOB@DB@@QEAA@XZ @386 NONAME
+??4AUTH_BLOB@DB@@QEAAAEAV01@AEBV01@@Z @387 NONAME
+??BAUTH_BLOB@DB@@QEAAPEADXZ @388 NONAME
+??BAUTH_BLOB@DB@@QEAAPEAEXZ @389 NONAME
+?get_contact@AUTH_BLOB@DB@@QEBAIXZ @390 NONAME
+?get_email@AUTH_BLOB@DB@@QEBAPEBDXZ @391 NONAME
+?get_firstName@AUTH_BLOB@DB@@QEBAPEBDXZ @392 NONAME
+?get_lastName@AUTH_BLOB@DB@@QEBAPEBDXZ @393 NONAME
+?get_nick@AUTH_BLOB@DB@@QEBAPEBDXZ @394 NONAME
+?get_reason@AUTH_BLOB@DB@@QEBAPEBDXZ @395 NONAME
+?get_uin@AUTH_BLOB@DB@@QEBAKXZ @396 NONAME
+?makeBlob@AUTH_BLOB@DB@@AEAAPEAEXZ @397 NONAME
+?size@AUTH_BLOB@DB@@QEBAKXZ @398 NONAME
Chat_UnescapeTags @399 NONAME
ProtoGetAvatarFormatByMimeType @400
ProtoGetAvatarMimeType @401
-?set_uin@DB_AUTH_BLOB@@QEAAXK@Z @402 NONAME
+?set_uin@AUTH_BLOB@DB@@QEAAXK@Z @402 NONAME
??0CSrmmBaseDialog@@IEAA@AEAVCMPluginBase@@HPEAUSESSION_INFO@@@Z @403 NONAME
Miranda_GetSystemWindow @404 NONAME
??1CSrmmBaseDialog@@UEAA@XZ @405 NONAME
@@ -732,3 +732,5 @@ ProtoBroadcastAsync @814 NONAME
?UseGroups@Clist@@3V?$CMOption@_N@@A @819 NONAME
?OfflineModes@Clist@@3V?$CMOption@K@@A @820 NONAME
?getChat@CSrmmBaseDialog@@QEBAPEAUSESSION_INFO@@XZ @821 NONAME
+?EventCursor@MDatabaseCommon@@UEAAPEAVEventCursorBase@DB@@IAEAUDBEVENTINFO@@@Z @822 NONAME
+?EventCursorRev@MDatabaseCommon@@UEAAPEAVEventCursorBase@DB@@IAEAUDBEVENTINFO@@@Z @823 NONAME
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index b6b2eba075..e000b647e1 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -436,6 +436,16 @@ MIR_CORE_DLL(MEVENT) db_event_setId(const char *szModule, MEVENT hDbEvent, const
return (currDb == nullptr) ? 0 : currDb->SetEventId(szModule, hDbEvent, szId);
}
+MIR_CORE_DLL(DB::EventCursor*) DB::Events(MCONTACT hContact, DBEVENTINFO &dbei)
+{
+ return (currDb == nullptr) ? 0 : currDb->EventCursor(hContact, dbei);
+}
+
+MIR_CORE_DLL(DB::EventCursor*) DB::EventsRev(MCONTACT hContact, DBEVENTINFO &dbei)
+{
+ return (currDb == nullptr) ? 0 : currDb->EventCursorRev(hContact, dbei);
+}
+
/////////////////////////////////////////////////////////////////////////////////////////
// misc functions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 762ddcc9be..3c49913455 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1457,3 +1457,11 @@ XmlGetChildText @1645
?InsertNewDeclaration@XMLElement@tinyxml2@@QAEPAVXMLDeclaration@2@PBD@Z @1679 NONAME
?InsertNewText@XMLElement@tinyxml2@@QAEPAVXMLText@2@PBD@Z @1680 NONAME
?InsertNewUnknown@XMLElement@tinyxml2@@QAEPAVXMLUnknown@2@PBD@Z @1681 NONAME
+??0EventCursorBase@DB@@QAE@$$QAV01@@Z @1684 NONAME
+??0EventCursorBase@DB@@QAE@ABV01@@Z @1685 NONAME
+??0EventCursorBase@DB@@QAE@IAAUDBEVENTINFO@@@Z @1686 NONAME
+??_7EventCursorBase@DB@@6B@ @1687 NONAME
+?Events@DB@@YGPAVEventCursorBase@1@IAAUDBEVENTINFO@@@Z @1688 NONAME
+?EventsRev@DB@@YGPAVEventCursorBase@1@IAAUDBEVENTINFO@@@Z @1689 NONAME
+?begin@EventCursorBase@DB@@QAEIXZ @1690 NONAME
+?end@EventCursorBase@DB@@QAEIXZ @1691 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index d7090d5360..e46be88bc5 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1457,3 +1457,11 @@ XmlGetChildText @1645
?InsertNewDeclaration@XMLElement@tinyxml2@@QEAAPEAVXMLDeclaration@2@PEBD@Z @1679 NONAME
?InsertNewText@XMLElement@tinyxml2@@QEAAPEAVXMLText@2@PEBD@Z @1680 NONAME
?InsertNewUnknown@XMLElement@tinyxml2@@QEAAPEAVXMLUnknown@2@PEBD@Z @1681 NONAME
+??0EventCursorBase@DB@@QEAA@$$QEAV01@@Z @1684 NONAME
+??0EventCursorBase@DB@@QEAA@AEBV01@@Z @1685 NONAME
+??0EventCursorBase@DB@@QEAA@IAEAUDBEVENTINFO@@@Z @1686 NONAME
+??_7EventCursorBase@DB@@6B@ @1687 NONAME
+?Events@DB@@YAPEAVEventCursorBase@1@IAEAUDBEVENTINFO@@@Z @1688 NONAME
+?EventsRev@DB@@YAPEAVEventCursorBase@1@IAEAUDBEVENTINFO@@@Z @1689 NONAME
+?begin@EventCursorBase@DB@@QEAAIXZ @1690 NONAME
+?end@EventCursorBase@DB@@QEAAIXZ @1691 NONAME