From f4375028eae5442720c07f59a74f5739c9dcc865 Mon Sep 17 00:00:00 2001 From: leecher1337 Date: Wed, 7 Dec 2016 21:39:25 +0100 Subject: MSN: Support for File.1 type file transfers. --- protocols/MSN/src/msn_commands.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 984c65e2cf..86824b85c6 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -483,7 +483,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) if (nlhrReply->resultCode == 200) { char *pLength, *pEnd; - if ((pLength = strstr(nlhrReply->pData, "\"contents\":")) && (pLength = strstr(pLength, "\"imgpsh\"")) && + if ((pLength = strstr(nlhrReply->pData, "\"contents\":")) && (pLength = strstr(pLength, "\"length\":")) && (pEnd = strchr(pLength+9, ','))) { pLength+=9; *pEnd = 0; @@ -496,7 +496,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) if (fileSize) { filetransfer* ft = new filetransfer(this); - char *pszFile = ""; + char *pszFile = "", *pszType; ezxml_t originalName, desc; ft->std.hContact = hContact; @@ -517,7 +517,10 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) ft->std.totalBytes = ft->std.currentFileSize = fileSize; ft->std.totalFiles = 1; ft->szInvcookie = (char*)mir_calloc(strlen(uri)+16); - sprintf(ft->szInvcookie, "%s/content/imgpsh", uri); + if ((pszType = (char*)ezxml_attr(xmli, "type")) && !mir_strcmp(pszType, "File.1")) + sprintf(ft->szInvcookie, "%s/content/original", uri); + else + sprintf(ft->szInvcookie, "%s/content/imgpsh", uri); wchar_t tComment[40]; mir_snwprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize); -- cgit v1.2.3