From f3eb289962574b7d42087f65a859a599f6117735 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 9 Oct 2010 09:32:19 +0300 Subject: modified: messages.cpp modified: new_gpg.rc modified: options.cpp modified: utilities.cpp --- messages.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'messages.cpp') diff --git a/messages.cpp b/messages.cpp index 6513867..ed6d252 100644 --- a/messages.cpp +++ b/messages.cpp @@ -370,7 +370,12 @@ int RecvMsgSvc(WPARAM w, LPARAM l) } return CallService(MS_PROTO_CHAINRECV, w, l); } -list msgs_to_ignore; +struct handle_plus_string +{ + string *str; + HANDLE hContact; +}; +list msgs_to_ignore; int SendMsgSvc(WPARAM w, LPARAM l) { CCSDATA *ccs = (CCSDATA*)l; @@ -384,7 +389,14 @@ int SendMsgSvc(WPARAM w, LPARAM l) return CallService(MS_PROTO_CHAINSEND, w, l); HANDLE hContact = ccs->hContact; if(metaIsProtoMetaContacts(hContact)) + { + string str_event = (char*)ccs->lParam; + handle_plus_string *hps = new handle_plus_string; + hps->str = new string(str_event); + hps->hContact = ccs->hContact; + msgs_to_ignore.push_back(hps); return CallService(MS_PROTO_CHAINSEND, w, l); + } // hContact = metaGetCurrent(hContact); if(!DBGetContactSettingByte(hContact, szGPGModuleName, "GPGEncryption", 0)) return CallService(MS_PROTO_CHAINSEND, w, l); @@ -513,7 +525,10 @@ int SendMsgSvc(WPARAM w, LPARAM l) { //dirty hack to avoid metacontacts problem ..., this also broke filters chain int returnNoError(HANDLE hContact); string str_event = (char*)ccs->lParam; - msgs_to_ignore.push_back(new string(str_event)); + handle_plus_string *hps = new handle_plus_string; + hps->str = new string(str_event); + hps->hContact = hContact; + msgs_to_ignore.push_back(hps); if(bAppendTags) { char *opentag = mir_utf8encodeW(outopentag); @@ -550,11 +565,11 @@ int HookSendMsg(WPARAM w, LPARAM l) return 1; if(!msgs_to_ignore.empty()) { - for(list::iterator p = msgs_to_ignore.begin(); p != msgs_to_ignore.end(); p++) + for(list::iterator p = msgs_to_ignore.begin(); p != msgs_to_ignore.end(); p++) { - if(!strcmp((*p)->c_str(), (char*)dbei->pBlob)) + if(((*p)->hContact == (HANDLE)w || (*p)->hContact == metaGetContact((HANDLE)w) || (*p)->hContact == metaGetCurrent((HANDLE)w)) && !strcmp((*p)->str->c_str(), (char*)dbei->pBlob)) { - delete *p; + delete (*p)->str; msgs_to_ignore.remove(*p); return 1; } -- cgit v1.2.3