diff options
author | George Hazan <ghazan@miranda.im> | 2018-03-13 22:39:40 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-03-13 22:39:40 +0300 |
commit | e9cb7ff7a1c115d63ed4e6af5f8fbd29f29459fe (patch) | |
tree | 9df6577f4f1c833714154160f16c23b85a4c8089 /plugins/CmdLine | |
parent | 1202cf04c667c72fb30bd01608585283b9cc1914 (diff) |
additional fix for #1143 (message with non-latin chars is stored as garbage being sent from the command line)
Diffstat (limited to 'plugins/CmdLine')
-rw-r--r-- | plugins/CmdLine/src/mimcmd_handlers.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/CmdLine/src/mimcmd_handlers.cpp b/plugins/CmdLine/src/mimcmd_handlers.cpp index 10caca7621..ad5a1cb216 100644 --- a/plugins/CmdLine/src/mimcmd_handlers.cpp +++ b/plugins/CmdLine/src/mimcmd_handlers.cpp @@ -742,7 +742,8 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re if (hContact) {
bShouldProcessAcks = TRUE;
- HANDLE hProcess = (HANDLE)ProtoChainSend(hContact, PSS_MESSAGE, 0, ptrA(Utf8EncodeW(message)));
+ ptrA szMessage(Utf8EncodeW(message));
+ HANDLE hProcess = (HANDLE)ProtoChainSend(hContact, PSS_MESSAGE, 0, szMessage);
const int MAX_COUNT = 60;
int counter = 0;
while (((ack = GetAck(hProcess)) == nullptr) && (counter < MAX_COUNT)) {
@@ -759,10 +760,10 @@ void HandleMessageCommand(PCommand command, TArgument *argv, int argc, PReply re DBEVENTINFO e = {};
char module[128];
e.eventType = EVENTTYPE_MESSAGE;
- e.flags = DBEF_SENT;
+ e.flags = DBEF_SENT | DBEF_UTF;
- e.pBlob = (PBYTE)message;
- e.cbBlob = (DWORD)mir_strlen((char *)message) + 1;
+ e.pBlob = (PBYTE)szMessage.get();
+ e.cbBlob = (DWORD)mir_strlen(szMessage) + 1;
strncpy_s(module, ack->szModule, _countof(module));
e.szModule = module;
|