summaryrefslogtreecommitdiff
path: root/protocols/ICQCorp/src/services.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-01-17 14:01:50 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-01-17 14:01:50 +0300
commit99b43a519c595bd9c75c10ad204880c5b924db8c (patch)
tree968841711f3f599d8261947e4f3207bbcfbd3a4c /protocols/ICQCorp/src/services.cpp
parentad306ac6ccc9ad3fc346d67140f6bcdb71857b7c (diff)
ICQCorp: fix for broken file transfers
Diffstat (limited to 'protocols/ICQCorp/src/services.cpp')
-rw-r--r--protocols/ICQCorp/src/services.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp
index 90f4354331..e50c3679e0 100644
--- a/protocols/ICQCorp/src/services.cpp
+++ b/protocols/ICQCorp/src/services.cpp
@@ -197,15 +197,15 @@ static INT_PTR icqRecvMessage(WPARAM, LPARAM lParam)
db_unset(ccs->hContact, "CList", "Hidden");
+ ptrA szMsg(Utf8CheckString(pre->szMessage) ? mir_strdup(pre->szMessage) : mir_utf8encode(pre->szMessage));
+
DBEVENTINFO dbei = {};
dbei.szModule = protoName;
dbei.timestamp = pre->timestamp;
- dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
- if (Utf8CheckString(pre->szMessage))
- dbei.flags |= DBEF_UTF;
+ dbei.flags = DBEF_UTF | (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)mir_strlen(pre->szMessage) + 1;
- dbei.pBlob = (PBYTE)pre->szMessage;
+ dbei.cbBlob = (DWORD)mir_strlen(szMsg) + 1;
+ dbei.pBlob = (PBYTE)szMsg.get();
db_event_add(ccs->hContact, &dbei);
return 0;
}