From 81bac0208e177b647682b4d115fe47547cd43ab6 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 4 Jan 2013 20:28:34 +0200 Subject: implemented #83 --- src/utilities.cpp | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 86 insertions(+), 7 deletions(-) (limited to 'src/utilities.cpp') diff --git a/src/utilities.cpp b/src/utilities.cpp index a430964..ab9b776 100755 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -328,14 +328,15 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) list transfers; -extern bool bFileTransfers; + +DWORD file_msg_state = -1; int onProtoAck(WPARAM w, LPARAM l) { ACKDATA *ack=(ACKDATA*)l; CCSDATA *ccs=(CCSDATA*)ack->lParam; - if(ack->type == ACKTYPE_FILE && bFileTransfers) + if(ack->type == ACKTYPE_FILE) { switch(ack->result) { @@ -363,6 +364,15 @@ int onProtoAck(WPARAM w, LPARAM l) } if(_tcsstr(filename, _T(".gpg"))) //decrypt it { //process encrypted file + if(!bFileTransfers && !bSameAction) + { + void ShowEncryptedFileMsgBox(); + ShowEncryptedFileMsgBox(); + } + if(!bFileTransfers && bSameAction) + return 0; + if(file_msg_state < 1) + return 0; HistoryLog(ack->hContact, db_event("Recieved encrypted file, trying to decrypt", 0,0, 0)); if(_waccess(f->tszCurrentFile, 0) == -1) { @@ -473,7 +483,7 @@ int onProtoAck(WPARAM w, LPARAM l) } out.clear(); gpg_execution_params params; - pxResult result; + //pxResult result; params.cmd = &cmd2; params.useless = ""; params.out = &out; @@ -486,16 +496,17 @@ int onProtoAck(WPARAM w, LPARAM l) TerminateProcess(params.hProcess, 1); params.hProcess = NULL; debuglog<