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() --- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- protocols/SkypeWeb/src/skype_db.cpp | 4 ++-- protocols/SkypeWeb/src/skype_proto.cpp | 11 +++++------ 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index ee2254ff27..c249c6e281 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -44,7 +44,7 @@ MCONTACT CSkypeProto::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/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 89235f6e4b..6f932e3910 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -49,7 +49,7 @@ MEVENT CSkypeProto::AddDbEvent(uint16_t type, MCONTACT hContact, uint32_t timest dbei.timestamp = timestamp; dbei.eventType = type; dbei.cbBlob = (uint32_t)mir_strlen(szMsg) + 1; - dbei.pBlob = (uint8_t *)szMsg; + dbei.pBlob = szMsg; dbei.flags = flags; dbei.szId = msgId; return db_event_add(hContact, &dbei); @@ -93,7 +93,7 @@ void CSkypeProto::EditEvent(MEVENT hEvent, const CMStringW &szContent, time_t ed std::string newMsg = jMsg.write().c_str(); dbei.cbBlob = int(newMsg.size() + 1); - dbei.pBlob = (uint8_t*)newMsg.c_str(); + dbei.pBlob = (char *)newMsg.c_str(); db_event_edit(hEvent, &dbei, true); } diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 35b500a0a7..59ad914aaa 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -286,15 +286,14 @@ int CSkypeProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre) for (int i = 0; i < nCount; i++) cbBlob += int(/*mir_wstrlen(isrList[i]->nick.w)*/0 + 2 + mir_wstrlen(isrList[i]->id.w) + mir_strlen(szMessageId)); - uint8_t *pBlob = (uint8_t*)mir_calloc(cbBlob); - uint8_t *pCurBlob = pBlob; + char *pBlob = (char *)mir_calloc(cbBlob); + char *pCurBlob = pBlob; for (int i = 0; i < nCount; i++) { - //mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w)); - pCurBlob += mir_strlen((PCHAR)pCurBlob) + 1; + pCurBlob += mir_strlen(pCurBlob) + 1; - mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.w)); - pCurBlob += mir_strlen((char*)pCurBlob) + 1; + mir_strcpy(pCurBlob, _T2A(isrList[i]->id.w)); + pCurBlob += mir_strlen(pCurBlob) + 1; } DBEVENTINFO dbei = {}; -- cgit v1.2.3