summaryrefslogtreecommitdiff
path: root/protocols/Sametime
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-25 23:47:56 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-25 23:47:56 +0300
commitea88e2c53d3ac0840955eb703213ca1430bb4361 (patch)
tree658c2290a12888922c9729a623d5d34e750bd626 /protocols/Sametime
parent45bf5f51cc788cb8f19e1b8fcd5b8818dc7a2e00 (diff)
PROTORECVFILE now uses const char/wchar_t pointers. also fixes #1864 completely
Diffstat (limited to 'protocols/Sametime')
-rw-r--r--protocols/Sametime/src/files.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index 080e23fcc4..a0b3d3dd74 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -28,27 +28,21 @@ void mwFileTransfer_offered(mwFileTransfer* ft)
proto->ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, (HANDLE)ft, 0);
- wchar_t* filenameT = mir_utf8decodeW(mwFileTransfer_getFileName(ft));
+ const char *filename = mwFileTransfer_getFileName(ft);
const char* message = mwFileTransfer_getMessage(ft);
- wchar_t descriptionT[512];
- if (message) {
- wchar_t* messageT = mir_utf8decodeW(message);
- mir_snwprintf(descriptionT, L"%s - %s", filenameT, messageT);
- mir_free(messageT);
- } else
- wcsncpy_s(descriptionT, filenameT, _TRUNCATE);
+ char description[512];
+ if (message)
+ mir_snprintf(description, "%s - %s", filename, message);
+ else
+ strncpy_s(description, filename, _TRUNCATE);
PROTORECVFILE pre = {0};
- pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(0);
- pre.descr.w = descriptionT;
- pre.files.w = &filenameT;
+ pre.descr.a = description;
+ pre.files.a = &filename;
pre.lParam = (LPARAM)ft;
-
ProtoChainRecvFile(hContact, &pre);
-
- mir_free(filenameT);
}
//returns 0 if finished with current file