From b9548a4f0c0c9315928814fb629f4e52fbebe66c Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 24 Aug 2010 00:30:00 +0300 Subject: modified: init.cpp modified: messages.cpp modified: new_gpg.rc modified: new_gpg.vcproj modified: options.cpp modified: srmm.cpp modified: utilities.cpp --- srmm.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'srmm.cpp') diff --git a/srmm.cpp b/srmm.cpp index d5f6061..b9f8ea1 100644 --- a/srmm.cpp +++ b/srmm.cpp @@ -45,7 +45,7 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { void setSrmmIcon(HANDLE); void setClistIcon(HANDLE); - TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); + bool isContactHaveKey(HANDLE hContact); BYTE enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); if(enc) { @@ -55,7 +55,7 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { } else if(!enc) { - if(_tcslen(key) < 1) + if(!isContactHaveKey(hContact)) { void ShowLoadPublicKeyDialog(); extern map user_data; @@ -69,12 +69,9 @@ int __cdecl onIconPressed(WPARAM wParam, LPARAM lParam) { DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1); setSrmmIcon(hContact); setClistIcon(hContact); - mir_free(key); return 0; } - mir_free(key); - key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); - if(_tcslen(key) > 0) + if(isContactHaveKey(hContact)) { DBWriteContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 1); setSrmmIcon(hContact); -- cgit v1.2.3