From 59822f2c393d553d43adb4a5eb8daf77609063f2 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 22 Mar 2011 14:09:37 +0200 Subject: new threading code (part 2, usable) --- utilities.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'utilities.cpp') diff --git a/utilities.cpp b/utilities.cpp index 05d0bde..40c4b32 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -933,7 +933,12 @@ void AddHandlers() bool isContactSecured(HANDLE hContact) { TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); - if(DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0) && (_tcslen(key) > 0)) + if(!key[0]) + { + mir_free(key); + key = UniGetContactSettingUtf(metaGetMostOnline(hContact), szGPGModuleName, "GPGPubKey", _T("")); + } + if((DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0) > 0 || DBGetContactSettingByte(metaGetMostOnline(hContact), szGPGModuleName, "GPGEncryption", 0) > 0) && (_tcslen(key) > 0)) { mir_free(key); return true; -- cgit v1.2.3