summaryrefslogtreecommitdiff
path: root/protocols/Tlen/src/tlen_thread.cpp
diff options
context:
space:
mode:
authorSzymon Tokarz <wsx22@o2.pl>2015-07-12 22:24:23 +0000
committerSzymon Tokarz <wsx22@o2.pl>2015-07-12 22:24:23 +0000
commit78573b079bec4aa315c4e2b87883ef6a1622b221 (patch)
tree19d175b2fa7c7baa458d7be69b7a65c7d5bd4c1a /protocols/Tlen/src/tlen_thread.cpp
parentf1f08af4d7a1b4bedf55fb25af974276e5eb858c (diff)
Tlen protocol
- fix encoding in send and receive messages, after commit 11066, tlen has never support PF4_IMSENDUTF git-svn-id: http://svn.miranda-ng.org/main/trunk@14547 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tlen/src/tlen_thread.cpp')
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 7b0b5ae460..4fdf7c6e80 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -712,11 +712,15 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info)
msgTime = time(NULL);
}
}
+ char* localMessage_Utf8 = mir_utf8encode(localMessage);
+
PROTORECVEVENT recv = { 0 };
recv.timestamp = (DWORD) msgTime;
- recv.szMessage = localMessage;
+ recv.szMessage = localMessage_Utf8;
recv.lParam = 0;
ProtoChainRecvMsg(hContact, &recv);
+
+ mir_free(localMessage_Utf8);
mir_free(localMessage);
}
}
@@ -931,12 +935,14 @@ static void TlenProcessW(XmlNode *node, ThreadData *info)
TlenStringAppend(&str, &strSize, "\r\n\r\n%s", body);
localMessage = TlenTextDecode(str);
+ char* localMessage_Utf8 = mir_utf8encode(localMessage);
PROTORECVEVENT recv = { 0 };
recv.timestamp = (DWORD) time(NULL);
- recv.szMessage = localMessage;
+ recv.szMessage = localMessage_Utf8;
ProtoChainRecvMsg(hContact, &recv);
+ mir_free(localMessage_Utf8);
mir_free(localMessage);
mir_free(str);
}
@@ -1016,11 +1022,14 @@ static void TlenProcessM(XmlNode *node, ThreadData *info)
db_set_b(hContact, info->proto->m_szModuleName, "bChat", TRUE);
mir_free(str);
localMessage = TlenTextDecode(bNode->text);
+ char* localMessage_Utf8 = mir_utf8encode(localMessage);
PROTORECVEVENT recv = { 0 };
recv.timestamp = (DWORD) timestamp;
- recv.szMessage = localMessage;
+ recv.szMessage = localMessage_Utf8;
ProtoChainRecvMsg(hContact, &recv);
+
+ mir_free(localMessage_Utf8);
mir_free(localMessage);
}
}