diff options
author | George Hazan <george.hazan@gmail.com> | 2012-09-17 14:45:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-09-17 14:45:41 +0000 |
commit | a30b2689d14a4026af2f3ebd01764bf896aaeb59 (patch) | |
tree | 0c4d5badc8b38f04ecd2281277e6107fa2dce3d6 /protocols/IcqOscarJ/oscar_filetransfer.cpp | |
parent | dbe6561e59a71811aa3975c792a3af86577c5cfa (diff) |
fix for the file transfer events
git-svn-id: http://svn.miranda-ng.org/main/trunk@1590 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/oscar_filetransfer.cpp')
-rw-r--r-- | protocols/IcqOscarJ/oscar_filetransfer.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/protocols/IcqOscarJ/oscar_filetransfer.cpp b/protocols/IcqOscarJ/oscar_filetransfer.cpp index 8a0db9a6f3..a1f516d363 100644 --- a/protocols/IcqOscarJ/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/oscar_filetransfer.cpp @@ -515,19 +515,15 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz else // or empty directory name
pszFileName = "";
- { // apply Filename / Directory Name encoding
- oscar_tlv* charset = chain->getTLV(0x2712, 1);
-
- if (charset)
- {
- char* szEnc = (char*)_alloca(charset->wLen + 1);
-
- null_strcpy(szEnc, (char*)charset->pData, charset->wLen);
- pszFileName = ApplyEncoding(pszFileName, szEnc);
- }
- else
- pszFileName = ansi_to_utf8(pszFileName);
+ // apply Filename / Directory Name encoding
+ oscar_tlv* charset = chain->getTLV(0x2712, 1);
+ if (charset) {
+ char* szEnc = (char*)_alloca(charset->wLen + 1);
+ null_strcpy(szEnc, (char*)charset->pData, charset->wLen);
+ pszFileName = ApplyEncoding(pszFileName, szEnc);
}
+ else pszFileName = ansi_to_utf8(pszFileName);
+
if (ft->wFilesCount == 1)
{ // Filename - use for DB event
char *szFileName = (char*)_alloca(strlennull(pszFileName) + 1);
@@ -570,10 +566,14 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz strcpy(szBlob + sizeof(DWORD), pszFileName);
strcpy(szBlob + sizeof(DWORD) + strlennull(pszFileName) + 1, pszDescription);
- PROTORECVEVENT pre;
- pre.flags = PREF_UTF;
+ TCHAR* ptszFileName = mir_a2t(pszFileName);
+
+ PROTORECVFILET pre = {0};
+ pre.flags = PREF_TCHAR;
+ pre.fileCount = 1;
pre.timestamp = time(NULL);
- pre.szMessage = szBlob;
+ pre.tszDescription = mir_a2t(pszDescription);
+ pre.ptszFiles = &ptszFileName;
pre.lParam = (LPARAM)ft;
CCSDATA ccs;
@@ -582,6 +582,9 @@ void CIcqProto::handleRecvServMsgOFT(BYTE *buf, WORD wLen, DWORD dwUin, char *sz ccs.wParam = 0;
ccs.lParam = (LPARAM)⪯
CallService(MS_PROTO_CHAINRECV, 0, (LPARAM)&ccs);
+
+ mir_free(pre.tszDescription);
+ mir_free(ptszFileName);
}
else if (wAckType == 2)
{ // First attempt failed, reverse requested
|