summaryrefslogtreecommitdiff
path: root/messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'messages.cpp')
-rw-r--r--messages.cpp25
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;
}