diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-20 13:34:45 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-20 13:34:45 +0300 |
commit | e96132b4d5344d2d58d247906bcaefccfb9d5253 (patch) | |
tree | 24a9524e4900547f2ba3a461e228fd3c98c0410d /protocols/Tox/src | |
parent | 4dac8bd56f9116ac76423b2664286ed894ca80c2 (diff) |
DBEVENTINFO::hContact to be returned inside an event, no need to call db_event_getContact() just after db_event_get()
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r-- | protocols/Tox/src/tox_contacts.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_messages.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_proto.h | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_utils.cpp | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Tox/src/tox_contacts.cpp b/protocols/Tox/src/tox_contacts.cpp index 7349f9ebe5..fffe9633ef 100644 --- a/protocols/Tox/src/tox_contacts.cpp +++ b/protocols/Tox/src/tox_contacts.cpp @@ -17,7 +17,7 @@ MCONTACT CToxProto::GetContactFromAuthEvent(MEVENT hEvent) uint32_t body[3];
DBEVENTINFO dbei = {};
dbei.cbBlob = sizeof(uint32_t) * 2;
- dbei.pBlob = (uint8_t*)&body;
+ dbei.pBlob = (char *)&body;
if (db_event_get(hEvent, &dbei))
return INVALID_CONTACT_ID;
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp index 77fe39b493..3cf6054f9e 100644 --- a/protocols/Tox/src/tox_messages.cpp +++ b/protocols/Tox/src/tox_messages.cpp @@ -151,7 +151,7 @@ int CToxProto::OnPreCreateMessage(WPARAM, LPARAM lParam) return 0;
evt->dbei->cbBlob = evt->dbei->cbBlob - 4;
- uint8_t *action = (uint8_t*)mir_alloc(evt->dbei->cbBlob);
+ char *action = (char *)mir_alloc(evt->dbei->cbBlob);
memcpy(action, &evt->dbei->pBlob[4], evt->dbei->cbBlob);
mir_free(evt->dbei->pBlob);
evt->dbei->pBlob = action;
diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 4109c00ecb..0c9f98f1b2 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -248,7 +248,7 @@ private: static bool IsFileExists(const wchar_t* path);
- MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, uint8_t *pBlob, size_t cbBlob);
+ MEVENT AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, char *pBlob, size_t cbBlob);
};
struct CMPlugin : public ACCPROTOPLUGIN<CToxProto>
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index b4840ddf97..7b7c39bfa8 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -126,10 +126,10 @@ bool CToxProto::IsFileExists(const wchar_t* path) return _waccess(path, 0) == 0;
}
-MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, uint8_t *pBlob, size_t cbBlob)
+MEVENT CToxProto::AddEventToDb(MCONTACT hContact, uint16_t type, uint32_t timestamp, uint32_t flags, char *pBlob, size_t cbBlob)
{
DBEVENTINFO dbei = {};
- dbei.szModule = this->m_szModuleName;
+ dbei.szModule = m_szModuleName;
dbei.timestamp = timestamp;
dbei.eventType = type;
dbei.cbBlob = (uint32_t)cbBlob;
|