summaryrefslogtreecommitdiff
path: root/utilities.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2011-03-22 14:09:37 +0200
committerGluzskiy Alexandr <sss123next@list.ru>2011-03-22 14:09:37 +0200
commit59822f2c393d553d43adb4a5eb8daf77609063f2 (patch)
tree6e53e461a18f78516ba12f6ca9670e7c7ce7584e /utilities.cpp
parent0ab2db678a2a79f624a74a51ac617110d9b4413e (diff)
new threading code (part 2, usable)
Diffstat (limited to 'utilities.cpp')
-rw-r--r--utilities.cpp7
1 files changed, 6 insertions, 1 deletions
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;