From e96132b4d5344d2d58d247906bcaefccfb9d5253 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Dec 2023 13:34:45 +0300 Subject: DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get() --- include/delphi/m_database.inc | 3 ++- include/m_database.h | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/delphi/m_database.inc b/include/delphi/m_database.inc index ab9e66984c..93baaf542e 100644 --- a/include/delphi/m_database.inc +++ b/include/delphi/m_database.inc @@ -42,7 +42,8 @@ type szModule : PAnsiChar; // module that 'owns' this event and controls the data format timestamp: dword; // timestamp in UNIX time flags : dword; // the DBEF_* flags above - eventType: word; // event type, such as message, can be module defined + eventType: dword; // event type, such as message, can be module defined + hContact : TMCONTACT; // contact to which this event belongs cbBlob : dword; // size in bytes of pBlob^ pBlob : PByte; // pointer to buffer containing the module defined event data szId : PAnsiChar; // server id of event diff --git a/include/m_database.h b/include/m_database.h index caf2546e42..7362c7ead9 100644 --- a/include/m_database.h +++ b/include/m_database.h @@ -188,9 +188,10 @@ struct DBEVENTINFO // unless you use the standard C library which is // signed and can only do until 2038. In GMT. uint32_t flags; // combination of DBEF_* flags - uint16_t eventType; // module-defined event type field + uint32_t eventType; // module-defined event type field + MCONTACT hContact; // contact to which this event belongs int cbBlob; // size of pBlob in bytes - uint8_t *pBlob; // pointer to buffer containing module-defined event data + char *pBlob; // pointer to buffer containing module-defined event data const char *szId; // server message id const char *szUserId; // user id (for group chats only) const char *szReplyId; // this message is a reply to a message with that server id @@ -747,15 +748,14 @@ namespace DB ptrA m_szNick, m_szFirstName, m_szLastName, m_szEmail, m_szReason; uint32_t m_size; - uint8_t* makeBlob(); + char* makeBlob(); public: explicit AUTH_BLOB(MCONTACT hContact, const char *nick, const char *fname, const char *lname, const char *id, const char *reason); - explicit AUTH_BLOB(uint8_t *blob); + explicit AUTH_BLOB(char *blob); ~AUTH_BLOB(); - __forceinline operator char*() { return (char*)makeBlob(); } - __forceinline operator uint8_t*() { return makeBlob(); } + __forceinline operator char*() { return makeBlob(); } __forceinline uint32_t size() const { return m_size; } -- cgit v1.2.3