diff options
-rw-r--r-- | commonheaders.h | 1 | ||||
-rw-r--r-- | init.cpp | 2 | ||||
-rw-r--r-- | main.cpp | 10 | ||||
-rw-r--r-- | new_gpg.rc | 18 | ||||
-rw-r--r-- | options.cpp | 4 | ||||
-rw-r--r-- | resource.h | 4 | ||||
-rw-r--r-- | utilities.cpp | 12 |
7 files changed, 42 insertions, 9 deletions
diff --git a/commonheaders.h b/commonheaders.h index 3670a86..57ba0af 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -65,6 +65,7 @@ using std::fstream; #include <m_protosvc.h> #include <m_netlib.h> #include <m_jabber.h> +#include <m_icqplus.h> #include <m_message.h> #include <m_cluiframes.h> #include <m_icolib.h> @@ -17,7 +17,7 @@ #include "commonheaders.h" //global variables -bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bIsMiranda09 = false, bMetaContacts = false, bFileTransfers = false; +bool bAppendTags = false, bDebugLog = false, bJabberAPI = false, bIsMiranda09 = false, bMetaContacts = false, bFileTransfers = false, bAutoExchange = false; TCHAR *inopentag = NULL, *inclosetag = NULL, *outopentag = NULL, *outclosetag = NULL, *password = NULL; list <JabberAccount*> Accounts; @@ -1528,6 +1528,16 @@ void InitCheck() if(MessageBoxA(0, question.c_str(), "Own secret key warning", MB_YESNO) == IDYES) ShowFirstRunDialog(); } + extern bool bAutoExchange; + if(bAutoExchange && (ServiceExists(PS_ICQ_ADDCAPABILITY))) + { + ICQ_CUSTOMCAP cap; + cap.cbSize = sizeof(ICQ_CUSTOMCAP); + cap.hIcon = 0; + strcpy(cap.name, "GPG Key AutoExchange"); + strcpy(cap.caps, "GPG AutoExchange"); + CallService(PS_ICQ_ADDCAPABILITY, 0, (LPARAM)&cap); + } } void ImportKey() @@ -320,8 +320,9 @@ BEGIN PUSHBUTTON "Browse",IDC_LOG_FILE_SET,119,156,50,14
CONTROL "Use jabber api on Miranda IM >= 0.9 (recomended)",IDC_JABBER_API,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,175,251,10
- LTEXT "Статический",IDC_CURRENT_KEY,48,196,116,8
+ LTEXT "Current key",IDC_CURRENT_KEY,48,196,116,8
CONTROL "Encrypt file transfers",IDC_FILE_TRANSFERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,185,137,10
+ CONTROL "Automatic key exchange",IDC_AUTO_EXCHANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,157,137,117,10
END
IDD_OPT_GPG_BIN DIALOGEX 0, 0, 282, 214
@@ -354,6 +355,21 @@ BEGIN RTEXT "Close:",IDC_STATIC,127,49,23,8
END
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT_GPG, DIALOG
+ BEGIN
+ END
+END
+#endif // APSTUDIO_INVOKED
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/options.cpp b/options.cpp index babaad1..948e5ac 100644 --- a/options.cpp +++ b/options.cpp @@ -188,6 +188,7 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if(bIsMiranda09) CheckStateLoadDB(hwndDlg, IDC_JABBER_API, "bJabberAPI", 1); CheckStateLoadDB(hwndDlg, IDC_FILE_TRANSFERS, "bFileTransfers", 1); + CheckStateLoadDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange", 0); return TRUE; } @@ -389,12 +390,13 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case PSN_APPLY: { - extern bool bDebugLog, bJabberAPI, bFileTransfers; + extern bool bDebugLog, bJabberAPI, bFileTransfers, bAutoExchange; bDebugLog = CheckStateStoreDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog"); if(bDebugLog) debuglog.init(); bJabberAPI = CheckStateStoreDB(hwndDlg, IDC_JABBER_API, "bJabberAPI"); bFileTransfers = CheckStateStoreDB(hwndDlg, IDC_FILE_TRANSFERS, "bFileTransfers"); + bAutoExchange = CheckStateStoreDB(hwndDlg, IDC_AUTO_EXCHANGE, "bAutoExchange"); { TCHAR tmp[512]; GetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, tmp, 512); @@ -70,6 +70,8 @@ #define IDC_FILE_TRANSFERS 1061
#define IDC_REMOVE_FILTERS 1062
#define IDC_GENERATE_RANDOM 1063
+#define IDC_CHECK1 1064
+#define IDC_AUTO_EXCHANGE 1064
// Next default values for new objects
//
@@ -77,7 +79,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 114
#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1064
+#define _APS_NEXT_CONTROL_VALUE 1065
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
diff --git a/utilities.cpp b/utilities.cpp index 8b52ce2..4a9fadc 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -282,6 +282,8 @@ int onProtoAck(WPARAM w, LPARAM l) PROTOFILETRANSFERSTATUS *f = (PROTOFILETRANSFERSTATUS*) ack->lParam;
if(!f)
f = (PROTOFILETRANSFERSTATUS*) ack->hProcess;
+ if(!f)
+ return 0;
switch(ack->result)
{
@@ -289,12 +291,10 @@ int onProtoAck(WPARAM w, LPARAM l) break;
case ACKRESULT_SUCCESS:
{
- if(sizeof(*f) != sizeof(PROTOFILETRANSFERSTATUS))
- break;
TCHAR *filename = NULL;
- if(f->szCurrentFile)
+ if(f->szCurrentFile && f->szCurrentFile[0])
filename = mir_utf8decodeW(f->szCurrentFile);
- else if(f->tszCurrentFile)
+ else if(f->tszCurrentFile && f->tszCurrentFile[0])
filename = mir_wstrdup(f->tszCurrentFile);
if(!filename)
break;
@@ -811,7 +811,9 @@ void AddHandlers() { (*p)->setPrescenseHandler((*p)->getJabberInterface()->Net()->AddPresenceHandler((JABBER_HANDLER_FUNC)PrescenseHandler)); } - + extern bool bAutoExchange; + if(bAutoExchange) + (*p)->getJabberInterface()->Net()->RegisterFeature(_T("GPG Key Auto Exchange"), _T("Indicates that gpg installed and configured to public key auto exchange (currently implemented in new_gpg Miranda IM plugin)")); } } |