diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-08 12:08:02 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-08 12:08:02 +0000 |
commit | 1b465bd6a7acd1ff1c6d5b910193a6163066fd4e (patch) | |
tree | 4f0de4584ce3f1b502848a2237166e680a8c9476 /plugins/MetaContacts | |
parent | 3e0eb53fca2111c541cf15d5bdd3282d048fd2fb (diff) |
same as previous
git-svn-id: http://svn.miranda-ng.org/main/trunk@4386 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MetaContacts')
-rwxr-xr-x | plugins/MetaContacts/src/meta_services.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/plugins/MetaContacts/src/meta_services.cpp b/plugins/MetaContacts/src/meta_services.cpp index 70109cc651..fc0d9d903c 100755 --- a/plugins/MetaContacts/src/meta_services.cpp +++ b/plugins/MetaContacts/src/meta_services.cpp @@ -229,9 +229,31 @@ INT_PTR MetaFilter_SendMessage(WPARAM wParam,LPARAM lParam) // if subcontact sending, add db event to keep metacontact history correct
if (options.metahistory && !(ccs->wParam & PREF_METANODB)) {
- HANDLE hContact = ccs->hContact; ccs->hContact = hMeta;
- CallService(MS_PROTO_CHAINSEND, 0, lParam);
- ccs->hContact = hContact;
+
+ // reject "file As Message" messages
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%fAM", 5) == 0)
+ return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
+
+ // reject "data As Message" messages
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "<%dAM", 5) == 0)
+ return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
+
+ // reject "OTR" messages
+ if (strlen((char *)ccs->lParam) > 5 && strncmp((char *)ccs->lParam, "?OTR", 4) == 0)
+ return CallService(MS_PROTO_CHAINSEND, wParam, lParam); // continue processing
+
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ dbei.szModule = META_PROTO;
+ dbei.flags = DBEF_SENT;
+ dbei.timestamp = time(NULL);
+ dbei.eventType = EVENTTYPE_MESSAGE;
+ if (ccs->wParam & PREF_RTL) dbei.flags |= DBEF_RTL;
+ if (ccs->wParam & PREF_UTF) dbei.flags |= DBEF_UTF;
+ dbei.cbBlob = (DWORD)strlen((char *)ccs->lParam) + 1;
+ if ( ccs->wParam & PREF_UNICODE )
+ dbei.cbBlob *= ( sizeof( wchar_t )+1 );
+ dbei.pBlob = (PBYTE)ccs->lParam;
+ db_event_add(hMeta, &dbei);
}
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
@@ -371,7 +393,7 @@ INT_PTR MetaFilter_RecvMessage(WPARAM wParam,LPARAM lParam) // add a clist event, so that e.g. there is an icon flashing
// (only add it when message api available, 'cause then we can remove the event when the message window is opened)
- if (message_window_api_enabled
+ if (message_window_api_enabled
&& db_get_b(ccs->hContact, META_PROTO, "WindowOpen", 0) == 0
&& db_get_b(hMeta, META_PROTO, "WindowOpen", 0) == 0
&& options.flash_meta_message_icon)
|