diff options
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r-- | otr/dllmain.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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
|