From 634b8c24ce27d4ceed8eb4bc726de97dba1c6f3a Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 8 May 2007 15:10:59 +0000 Subject: added code to fix filter order problem introduced in earlier versions git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@170 4f64403b-2f21-0410-a795-97e2b3489a10 --- otr/dllmain.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'otr/dllmain.cpp') diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp index 7780324..7b67140 100644 --- a/otr/dllmain.cpp +++ b/otr/dllmain.cpp @@ -703,6 +703,7 @@ int OTRSendMessageW(WPARAM wParam, LPARAM lParam){ */ int RecvMessage(WPARAM wParam,LPARAM lParam){ + //PUShowMessage("OTR Recv Message", SM_NOTIFY); CCSDATA *ccs = (CCSDATA *) lParam; PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam; @@ -1210,6 +1211,16 @@ extern "C" DLLIMPORT int Load(PLUGINLINK *link) { pd.type = PROTOTYPE_ENCRYPTION; CallService(MS_PROTO_REGISTERMODULE,0,(LPARAM)&pd); + // remove us as a filter to all contacts - fix filter type problem + if(DBGetContactSettingByte(0, MODULE, "FilterOrderFix", 0) != 2) { + HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); + while ( hContact != NULL ) { + CallService( MS_PROTO_REMOVEFROMCONTACT, ( WPARAM )hContact, ( LPARAM )MODULE ); + hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDNEXT,( WPARAM )hContact, 0 ); + } + DBWriteContactSettingByte(0, MODULE, "FilterOrderFix", 2); + } + // add us as a filter to all contacts HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 ); while ( hContact != NULL ) { -- cgit v1.2.3