From 1f5acb24f8483d5d6b0e55299579ad5ee975c9b1 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 30 Nov 2010 18:25:48 +0200 Subject: fixed crash on metacontacts key import --- main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 7a189e2..ebe5ed8 100644 --- a/main.cpp +++ b/main.cpp @@ -1726,7 +1726,6 @@ void ImportKey() if(metaIsProtoMetaContacts(hContact)) if(MessageBox(0, _T("Do you want load key for all subcontacts ?"), _T("Metacontact detected"), MB_YESNO) == IDYES) for_all_sub = true; - if(metaIsProtoMetaContacts(hContact)) { HANDLE hcnt = NULL; @@ -1760,7 +1759,10 @@ void ImportKey() _tcscat(tmp2, _T("temporary_exported.asc")); DeleteFile(tmp2); wfstream f(tmp2, std::ios::out); - ptmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); + if(metaIsProtoMetaContacts(hContact)) + ptmp = UniGetContactSettingUtf(metaGetCurrent(hContact), szGPGModuleName, "GPGPubKey", _T("")); + else + ptmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); wstring new_key = ptmp; mir_free(ptmp); f<