From e224f1745a79e44c9c1a4a7f26c730b768dac010 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 9 Oct 2010 08:34:40 +0300 Subject: srmm icon fix for metacontacts --- commonheaders.h | 1 + icons.cpp | 3 ++- init.cpp | 2 +- metacontacts.cpp | 6 +++--- options.cpp | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/commonheaders.h b/commonheaders.h index 49a1b4d..1faf221 100644 --- a/commonheaders.h +++ b/commonheaders.h @@ -44,6 +44,7 @@ using std::fstream; //boost #include #include +//#include //miranda #include diff --git a/icons.cpp b/icons.cpp index c32d5dd..96c4f50 100644 --- a/icons.cpp +++ b/icons.cpp @@ -102,7 +102,8 @@ void setClistIcon(HANDLE hContact) void setSrmmIcon(HANDLE hContact) { - bool enabled = isContactSecured(hContact); + hContact = metaGetCurrent(hContact); + bool enabled = isContactSecured(hContact); HANDLE hMC = metaGetContact(hContact); if(ServiceExists(MS_MSG_MODIFYICON)) { // обновить иконки в srmm diff --git a/init.cpp b/init.cpp index 38fe926..1530f82 100644 --- a/init.cpp +++ b/init.cpp @@ -228,7 +228,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam) extern "C" int __declspec(dllexport) Unload(void) -{ +{ for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) DBDeleteContactSetting(hContact, szGPGModuleName, "KeyID_Prescense"); mir_free(inopentag); diff --git a/metacontacts.cpp b/metacontacts.cpp index b0eb8bf..d1e959c 100644 --- a/metacontacts.cpp +++ b/metacontacts.cpp @@ -75,9 +75,9 @@ HANDLE metaGetCurrent(HANDLE hContact) { if(!metaIsProtoMetaContacts(hContact)) return hContact; - HANDLE hcnt = metaGetDefault(hContact); - if(!IsOnline(hcnt)) - hcnt = metaGetMostOnline(hContact); + HANDLE hcnt = metaGetMostOnline (hContact); + if(!hcnt) + hcnt = metaGetDefault(hContact); return hcnt; } return hContact; diff --git a/options.cpp b/options.cpp index 7061f39..9836d67 100644 --- a/options.cpp +++ b/options.cpp @@ -637,7 +637,7 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } } char *tmp = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID_Prescense", ""); - if(strlen(tmp) > 0) + if(tmp[0]) { char *tmp2 = UniGetContactSettingUtf(hcnt, szGPGModuleName, "KeyID", ""); if(strlen(tmp2) == 0) -- cgit v1.2.3