summaryrefslogtreecommitdiff
path: root/protocols/EmLanProto
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-02-25 23:04:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-02-25 23:04:28 +0300
commit3361bc0c6d4f17b7eca7fe04801b2e3e41ab2da3 (patch)
tree2f27b92ad0e5ba2070067ab51dedfe4596efe775 /protocols/EmLanProto
parent5f2ea9e3aaa8e605a538b84786154db67fa6223b (diff)
EmLAN: fix for messages encoding
Diffstat (limited to 'protocols/EmLanProto')
-rw-r--r--protocols/EmLanProto/src/mlan.cpp10
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");