From 3361bc0c6d4f17b7eca7fe04801b2e3e41ab2da3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 25 Feb 2017 23:04:20 +0300 Subject: EmLAN: fix for messages encoding --- protocols/EmLanProto/src/mlan.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 76b52bffae..cc3f7b2d2a 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -370,6 +370,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) void CMLan::RecvMessageUrl(CCSDATA* ccs) { PROTORECVEVENT *pre = (PROTORECVEVENT*)ccs->lParam; + ptrA szMessage(Utf8Encode(pre->szMessage)); DBEVENTINFO dbei = {}; if (!mir_strcmp(ccs->szProtoService, PSR_MESSAGE)) @@ -378,12 +379,9 @@ void CMLan::RecvMessageUrl(CCSDATA* ccs) dbei.eventType = EVENTTYPE_URL; dbei.szModule = PROTONAME; dbei.timestamp = pre->timestamp; - dbei.flags = pre->flags & PREF_CREATEREAD ? DBEF_READ : 0; - dbei.cbBlob = (DWORD)mir_strlen(pre->szMessage) + 1; - if (!mir_strcmp(ccs->szProtoService, PSR_URL)) { - dbei.cbBlob += 2 + (DWORD)mir_strlen(pre->szMessage + dbei.cbBlob + 1); - } - dbei.pBlob = (PBYTE)pre->szMessage; + dbei.flags = DBEF_UTF + (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0; + dbei.cbBlob = (DWORD)mir_strlen(szMessage) + 1; + dbei.pBlob = (PBYTE)szMessage.get(); db_unset(ccs->hContact, "CList", "Hidden"); -- cgit v1.2.3