From 1f4c1f489f05bb135c8df93d40db9bb624be969d Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Wed, 27 Oct 2010 07:46:37 +0300 Subject: key autoexchange implementation started --- utilities.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'utilities.cpp') 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)")); } } -- cgit v1.2.3