From 3330fbbb3f62f072fa7e80102995b3012e0e552d Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Mon, 2 Jun 2008 05:52:38 +0000 Subject: fix for API change (Accounts related) to PSS_MESSAGE protocol service git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@410 4f64403b-2f21-0410-a795-97e2b3489a10 --- otr/dllmain.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'otr/dllmain.cpp') diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp index c254fcc..368060d 100644 --- a/otr/dllmain.cpp +++ b/otr/dllmain.cpp @@ -288,12 +288,17 @@ extern "C" void otr_gui_inject_message(void *opdata, const char *accountname, co HANDLE hContact = (HANDLE)opdata; // bypass filters (including this module, metacontacts, etc) - go direct to proto level + // mod for new account stuff - OTRSendMessage will ignore messages starting with "?OTR" - 'new' protocols expect args (flags, char *) instead of (0, CSSDATA*) if(protocol && DBGetContactSettingWord(hContact, protocol, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) { + /* CCSDATA ccs = {0}; ccs.hContact = hContact; ccs.szProtoService = PSS_MESSAGE; ccs.lParam = (LPARAM)Translate(message); - CallProtoService(protocol, PSS_MESSAGE, 0, (LPARAM)&ccs); + CallContactService( + CallService(protocol, PSS_MESSAGE, 0, (LPARAM)&ccs); + */ + CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)Translate(message)); } } @@ -691,6 +696,12 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){ free(temp); } + + // don't filter OTR messages being sent (OTR messages should only happen *after* the otrl_message_sending call below) + if(strncmp(oldmessage_utf, "?OTR", 4) == 0) { + free(oldmessage_utf); + return CallService(MS_PROTO_CHAINSEND, wParam, lParam); + } char *username = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, 0); // check if we're waiting for the other side to accept a new key from us -- cgit v1.2.3