diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-25 23:47:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-25 23:47:56 +0300 |
commit | ea88e2c53d3ac0840955eb703213ca1430bb4361 (patch) | |
tree | 658c2290a12888922c9729a623d5d34e750bd626 /protocols/MSN | |
parent | 45bf5f51cc788cb8f19e1b8fcd5b8818dc7a2e00 (diff) |
PROTORECVFILE now uses const char/wchar_t pointers. also fixes #1864 completely
Diffstat (limited to 'protocols/MSN')
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index dd96ff43b7..0a4fa74562 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -423,7 +423,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) if (fileSize) {
filetransfer* ft = new filetransfer(this);
- char *pszFile = "", *pszType;
+ const char *pszFile = "", *pszType;
ezxml_t originalName, desc;
ft->std.hContact = hContact;
@@ -431,7 +431,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) mir_free(ft->std.szCurrentFile.w);
if (!((originalName = ezxml_child(xmli, "OriginalName")) && (pszFile = (char*)ezxml_attr(originalName, "v"))))
if ((originalName = ezxml_child(xmli, "meta")))
- pszFile = (char*)ezxml_attr(originalName, "originalName");
+ pszFile = ezxml_attr(originalName, "originalName");
if (!pszFile || !*pszFile) {
if ((originalName = ezxml_child(xmli, "meta")) && (pszFile = (char*)ezxml_attr(originalName, "type")))
@@ -442,7 +442,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) pszFile = "file";
}
- char *p;
+ const char *p;
if ((p = strrchr(pszFile, '\\')) || (p = strrchr(pszFile, '/')))
pszFile = p + 1;
@@ -455,18 +455,16 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) else
sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
- wchar_t tComment[40];
- mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ char tComment[40];
+ mir_snprintf(tComment, TranslateU("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILE pre = { 0 };
- pre.dwFlags = PRFF_UNICODE;
pre.fileCount = 1;
pre.timestamp = time(0);
- pre.descr.w = (desc = ezxml_child(xmli, "Description")) ? mir_utf8decodeW(desc->txt) : tComment;
- pre.files.w = &ft->std.szCurrentFile.w;
+ pre.descr.a = (desc = ezxml_child(xmli, "Description")) ? desc->txt : tComment;
+ pre.files.a = &pszFile;
pre.lParam = (LPARAM)ft;
ProtoChainRecvFile(ft->std.hContact, &pre);
- if (desc) mir_free(pre.descr.w);
}
else uri = nullptr;
}
|