diff options
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r-- | protocols/ICQ-WIM/src/menus.cpp | 4 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/proto.cpp | 8 | ||||
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 2 |
3 files changed, 6 insertions, 8 deletions
diff --git a/protocols/ICQ-WIM/src/menus.cpp b/protocols/ICQ-WIM/src/menus.cpp index 4cb75fe7b0..b78b308f43 100644 --- a/protocols/ICQ-WIM/src/menus.cpp +++ b/protocols/ICQ-WIM/src/menus.cpp @@ -47,13 +47,13 @@ INT_PTR CIcqProto::SvcExecMenu(WPARAM iCommand, LPARAM pHandle) IcqFileInfo *pFileInfo = nullptr; CMStringW wszText(ptrW(DbEvent_GetTextW(&dbei, CP_UTF8))); - if (CheckFile(db_event_getContact(hEvent), wszText, pFileInfo)) { + if (CheckFile(dbei.hContact, wszText, pFileInfo)) { if (!pFileInfo || pFileInfo->bIsSticker) { // sticker is a simple text message prcoessed by SmileyAdd T2Utf szBody(wszText); mir_free(dbei.pBlob); dbei.cbBlob = (int)mir_strlen(szBody.get()); - dbei.pBlob = (uint8_t*)szBody.detach(); + dbei.pBlob = szBody.detach(); } else { // create the offline file event diff --git a/protocols/ICQ-WIM/src/proto.cpp b/protocols/ICQ-WIM/src/proto.cpp index 30bc7ab707..277ecb6501 100644 --- a/protocols/ICQ-WIM/src/proto.cpp +++ b/protocols/ICQ-WIM/src/proto.cpp @@ -241,8 +241,7 @@ void __cdecl CIcqProto::OfflineFileThread(void *pParam) CMStringW wszUrl;
if (fileText2url(blob.getUrl(), &wszUrl)) {
- MCONTACT hContact = db_event_getContact(ofd->hDbEvent);
- if (auto *pFileInfo = RetrieveFileInfo(hContact, wszUrl)) {
+ if (auto *pFileInfo = RetrieveFileInfo(dbei.hContact, wszUrl)) {
if (!ofd->bCopy) {
auto *pReq = new AsyncHttpRequest(CONN_NONE, REQUEST_GET, pFileInfo->szUrl, &CIcqProto::OnFileRecv);
pReq->pUserInfo = ofd;
@@ -561,10 +560,9 @@ int CIcqProto::SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszSrc DB::EventInfo dbei(hReplyEvent);
if (dbei) {
JSONNode replyTo;
- MCONTACT replyContact = db_event_getContact(hReplyEvent);
- CMStringA replyId(GetUserId(replyContact));
+ CMStringA replyId(GetUserId(dbei.hContact));
replyTo << CHAR_PARAM("mediaType", "quote") << CHAR_PARAM("sn", replyId) << INT_PARAM("time", dbei.timestamp)
- << CHAR_PARAM("msgId", dbei.szId) << WCHAR_PARAM("friendly", Clist_GetContactDisplayName(replyContact, 0))
+ << CHAR_PARAM("msgId", dbei.szId) << WCHAR_PARAM("friendly", Clist_GetContactDisplayName(dbei.hContact, 0))
<< WCHAR_PARAM("text", ptrW(DbEvent_GetTextW(&dbei, CP_UTF8)));
parts.push_back(replyTo);
}
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index a44c753bec..0b4213c09d 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -653,7 +653,7 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo if (bCreateRead)
dbei.flags |= DBEF_READ;
dbei.cbBlob = (int)mir_strlen(szUtf);
- dbei.pBlob = (BYTE*)szUtf.get();
+ dbei.pBlob = szUtf.get();
dbei.szId = szMsgId;
if (isChatRoom(hContact))
dbei.szUserId = szSender;
|