summaryrefslogtreecommitdiff
path: root/otr/dllmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r--otr/dllmain.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp
index 368060d..f4711b4 100644
--- a/otr/dllmain.cpp
+++ b/otr/dllmain.cpp
@@ -295,8 +295,7 @@ extern "C" void otr_gui_inject_message(void *opdata, const char *accountname, co
ccs.hContact = hContact;
ccs.szProtoService = PSS_MESSAGE;
ccs.lParam = (LPARAM)Translate(message);
- CallContactService(
- CallService(protocol, PSS_MESSAGE, 0, (LPARAM)&ccs);
+ CallProtoService(protocol, PSS_MESSAGE, 0, (LPARAM)&ccs);
*/
CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)Translate(message));
}
@@ -659,9 +658,14 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){
//MessageBox(0, (char *)ccs->lParam, "OTR - sending raw message", MB_OK);
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ccs->hContact, 0);
- if(proto && metaproto && strcmp(proto, metaproto) == 0) // bypass for metacontacts
+ if(proto && metaproto && strcmp(proto, metaproto) == 0) {// bypass for metacontacts
+ //PUShowMessage("OTR bypassing metacontact", SM_NOTIFY);
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
- if(!proto) return 1; // error
+ }
+ if(!proto) {
+ //PUShowMessage("OTR error no proto", SM_NOTIFY);
+ return 1; // error
+ }
gcry_error_t err;
char *newmessage = 0;
@@ -700,6 +704,7 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){
// 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);
+ PUShowMessage("OTR skipping otr message", SM_NOTIFY);
return CallService(MS_PROTO_CHAINSEND, wParam, lParam);
}
@@ -813,7 +818,8 @@ int OTRSendMessageW(WPARAM wParam, LPARAM lParam){
if(!lParam) return 0;
CCSDATA *ccs = (CCSDATA *) lParam;
- ccs->wParam |= PREF_UNICODE;
+ if(!(ccs->wParam & PREF_UTF))
+ ccs->wParam |= PREF_UNICODE;
return OTRSendMessage(wParam, lParam);
}