diff options
Diffstat (limited to 'protocols/ICQCorp/src/services.cpp')
-rw-r--r-- | protocols/ICQCorp/src/services.cpp | 10 |
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;
}
|