From 34571247cb430bcc9be56630e9fb0a714b5fd4c8 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Fri, 1 Apr 2011 05:50:42 +0300 Subject: modified: icons.cpp modified: messages.cpp modified: utilities.cpp --- icons.cpp | 10 +++++++--- messages.cpp | 9 ++++++++- utilities.cpp | 2 -- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/icons.cpp b/icons.cpp index cd32911..882f58b 100644 --- a/icons.cpp +++ b/icons.cpp @@ -82,7 +82,9 @@ void setClistIcon(HANDLE hContact) bool enabled = isContactSecured(hContact); extern HANDLE g_hCLIcon; HANDLE hMC = hContact; - if(metaIsProtoMetaContacts(hContact)) + if(metaIsSubcontact(hContact)) + hMC = metaGetContact(hContact); + else if(metaIsProtoMetaContacts(hContact)) hMC = metaGetContact(hContact); if(g_hCLIcon && enabled) { @@ -107,10 +109,12 @@ void setSrmmIcon(HANDLE hContact) hContact = metaGetMostOnline(hContact); bool enabled = isContactSecured(hContact); HANDLE hMC = hContact; - if(metaIsProtoMetaContacts(hContact)) + if(metaIsSubcontact(hContact)) + hMC = metaGetContact(hContact); + else if(metaIsProtoMetaContacts(hContact)) hMC = metaGetContact(hContact); if(ServiceExists(MS_MSG_MODIFYICON)) - { // обновить иконки в srmm + { StatusIconData sid = {0}; sid.cbSize = sizeof(sid); sid.szModule = szGPGModuleName; diff --git a/messages.cpp b/messages.cpp index f7ea63f..f421e4a 100644 --- a/messages.cpp +++ b/messages.cpp @@ -729,9 +729,12 @@ int SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags) if(metaIsSubcontact(hContact)) { hcontact_data[metaGetContact(hContact)].msgs_to_pass.push_back(str_event); + debuglog<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<"is subcontact of"<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)metaGetContact(hContact), GCDNF_TCHAR)<<"\n"; + debuglog<pBlob)) { hcontact_data[hContact].msgs_to_pass.erase(i); + debuglog<pBlob<<"\" passed event filter, contact "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<", message is in allowed list\n"; event_processing_mutex.unlock(); return 0; } @@ -860,7 +864,10 @@ int HookSendMsg(WPARAM w, LPARAM l) return 1; } if(!isContactSecured(hContact)) + { + debuglog<pBlob<<"\" passed event filter, contact "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" is unsecured\n"; return 0; + } if(!(dbei->flags & DBEF_SENT) && metaIsProtoMetaContacts((HANDLE)w)) { char tmp[29]; @@ -869,7 +876,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(strstr(tmp, "-----BEGIN PGP MESSAGE-----")) return 1; } - return 0; + return 1; } diff --git a/utilities.cpp b/utilities.cpp index d368c56..83407d0 100644 --- a/utilities.cpp +++ b/utilities.cpp @@ -975,8 +975,6 @@ void AddHandlers() bool isContactSecured(HANDLE hContact) { - if(metaIsProtoMetaContacts(hContact)) - hContact = metaGetContact(hContact); BYTE gpg_enc = DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0); if(!gpg_enc) return false; -- cgit v1.2.3