diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-09 09:32:19 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-10-09 09:32:19 +0300 |
commit | f3eb289962574b7d42087f65a859a599f6117735 (patch) | |
tree | 1bd862bea6bae962f5488247a8981e2d79db334d /messages.cpp | |
parent | e224f1745a79e44c9c1a4a7f26c730b768dac010 (diff) |
modified: messages.cpp
modified: new_gpg.rc
modified: options.cpp
modified: utilities.cpp
Diffstat (limited to 'messages.cpp')
-rw-r--r-- | messages.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
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<string*> msgs_to_ignore; +struct handle_plus_string +{ + string *str; + HANDLE hContact; +}; +list<handle_plus_string*> 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<string*>::iterator p = msgs_to_ignore.begin(); p != msgs_to_ignore.end(); p++) + for(list<handle_plus_string*>::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; } |