diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2011-04-01 05:50:42 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2011-04-01 05:50:42 +0300 |
commit | 34571247cb430bcc9be56630e9fb0a714b5fd4c8 (patch) | |
tree | 84f04ce5aa4110d2eaf1b65578b28cb533531bf5 | |
parent | 8cdda41b119526a2741938d57b7e066e1697315b (diff) |
modified: icons.cpp
modified: messages.cpp
modified: utilities.cpp
-rw-r--r-- | icons.cpp | 10 | ||||
-rw-r--r-- | messages.cpp | 9 | ||||
-rw-r--r-- | utilities.cpp | 2 |
3 files changed, 15 insertions, 6 deletions
@@ -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<<time_str()<<": adding event to metacontact: "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)metaGetContact(hContact), GCDNF_TCHAR)<<" on send message.\n"; HistoryLog(metaGetContact(hContact), (char*)str_event.c_str(), EVENTTYPE_MESSAGE, DBEF_SENT|dbflags); } hcontact_data[hContact].msgs_to_pass.push_back(str_event); + debuglog<<time_str()<<": adding event to contact: "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" on send message.\n"; HistoryLog(hContact, (char*)str_event.c_str(), EVENTTYPE_MESSAGE, dbflags|DBEF_SENT); if(!(flags & PREF_UTF)) flags |= PREF_UTF; @@ -851,6 +854,7 @@ int HookSendMsg(WPARAM w, LPARAM l) if(!strcmp((*i).c_str(), (char*)dbei->pBlob)) { hcontact_data[hContact].msgs_to_pass.erase(i); + debuglog<<time_str()<<": event message: \""<<(char*)dbei->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<<time_str()<<": event message: \""<<(char*)dbei->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; |