From ed8a4f7a485a222ebdf30aa6fd2e7c2344ec27f0 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Mon, 21 Mar 2011 01:47:46 +0200 Subject: modified: utilities.cpp --- utilities.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index e14cfc0..82a30bf 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -359,9 +359,9 @@ int onProtoAck(WPARAM w, LPARAM l) //from secureim partially int onSendFile(WPARAM w, LPARAM l) { - CCSDATA *ccs=(CCSDATA*)l; if(!bFileTransfers) return CallService(MS_PROTO_CHAINSEND, w, l); + CCSDATA *ccs=(CCSDATA*)l; if(isContactSecured(ccs->hContact)) { TCHAR **file=(TCHAR **)ccs->lParam; @@ -370,6 +370,9 @@ int onSendFile(WPARAM w, LPARAM l) { if (_tcsstr(file[i],_T(".gpg"))) continue; + if(_waccess(file[i], 0) == -1) + if(errno == ENOENT) + return 0; //we do not want to send file unencrypted (sometimes ack have wrong info) TCHAR *name = _tcsrchr(file[i],_T('\\')); if( !name ) name = file[i]; @@ -389,7 +392,7 @@ int onSendFile(WPARAM w, LPARAM l) mir_free(szKeyid); mir_free(keyid); cmd += _T(" -o \""); - TCHAR *temp = _wgetenv(_T("TEMP")); + TCHAR *temp = _tgetenv(_T("TEMP")); cmd += temp; cmd += _T("\\"); cmd += file_out; @@ -436,8 +439,10 @@ int onSendFile(WPARAM w, LPARAM l) } } } - mir_free(file[i]); - file[i]=mir_tstrdup(path_out.c_str()); +// mir_free(file[i]); +// file[i] = mir_tstrdup(path_out.c_str()); + mir_realloc(file[i], path_out.length()*sizeof(TCHAR)+1); + _tcscpy(file[i], path_out.c_str()); delete [] file_out; transfers.push_back(path_out); } -- cgit v1.2.3