diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-25 23:04:20 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-25 23:04:28 +0300 |
commit | 3361bc0c6d4f17b7eca7fe04801b2e3e41ab2da3 (patch) | |
tree | 2f27b92ad0e5ba2070067ab51dedfe4596efe775 /protocols/EmLanProto/src | |
parent | 5f2ea9e3aaa8e605a538b84786154db67fa6223b (diff) |
EmLAN: fix for messages encoding
Diffstat (limited to 'protocols/EmLanProto/src')
-rw-r--r-- | protocols/EmLanProto/src/mlan.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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"); |