diff options
-rw-r--r-- | commonheaders.h | 3 | ||||
-rw-r--r-- | utilities.cpp | 29 |
2 files changed, 27 insertions, 5 deletions
diff --git a/commonheaders.h b/commonheaders.h index e7b6e7e..d76cc58 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -15,6 +15,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef COMMONHEADERS_H #define COMMONHEADERS_H +#define MIRANDA_VER 0x0901 #include <windows.h> #include <locale.h> #include <shlobj.h> @@ -38,8 +39,6 @@ using std::wstring; using std::wfstream; using std::fstream; -#define MIRANDA_VER 0x0801 - #include <newpluginapi.h> #include <m_database.h> #include <m_options.h> diff --git a/utilities.cpp b/utilities.cpp index dc86ecf..271afb2 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -278,18 +278,41 @@ int onProtoAck(WPARAM w, LPARAM l) if (ack->type!=ACKTYPE_FILE)
return 0;
if(!isContactHaveKey(ack->hContact))
- return 0;
+ return 0;
PROTOFILETRANSFERSTATUS *f = (PROTOFILETRANSFERSTATUS*) ack->lParam;
- if (f && f->sending && !bFileTransfers)
+ if (f && (f->flags & PFTS_SENDING) && !bFileTransfers)
return 0;
+ if(!f)
+ f = (PROTOFILETRANSFERSTATUS*) ack->hProcess;
+
switch(ack->result)
{
case ACKRESULT_DENIED: case ACKRESULT_FAILED:
{
+ if(!f->tszWorkingDir)
+ return 0;
+ if(_tcsstr(f->tszCurrentFile, _T(".gpg")))
+ ;
+ }
+ break;
+ case ACKRESULT_NEXTFILE: case ACKRESULT_FILERESUME: //works only on receiving (than it useless ...)
+ {
+ wstring str = _T("Next:\n");
+ str.append(f->tszCurrentFile).append(_T("\n"));
+ MessageBox(0, str.c_str(), _T(""), MB_OK);
}
break;
- case ACKRESULT_NEXTFILE: case ACKRESULT_SUCCESS:
+ case ACKRESULT_SUCCESS:
{
+ if(!f->tszWorkingDir)
+ return 0;
+ if(_tcsstr(f->tszCurrentFile, _T(".gpg")))
+ { //process encrypted file
+ if(f->flags & PFTS_SENDING)
+ DeleteFile(f->tszCurrentFile);
+ if(f->flags & PFTS_RECEIVING)
+ ;
+ }
}
break;
}
|