summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/proto.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-20 13:34:45 +0300
commite96132b4d5344d2d58d247906bcaefccfb9d5253 (patch)
tree24a9524e4900547f2ba3a461e228fd3c98c0410d /protocols/ICQ-WIM/src/proto.cpp
parent4dac8bd56f9116ac76423b2664286ed894ca80c2 (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/ICQ-WIM/src/proto.cpp')
-rw-r--r--protocols/ICQ-WIM/src/proto.cpp8
1 files changed, 3 insertions, 5 deletions
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);
}