summaryrefslogtreecommitdiff
path: root/otr/dllmain.cpp
diff options
context:
space:
mode:
author(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2008-06-02 05:52:38 +0000
committer(no author) <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10>2008-06-02 05:52:38 +0000
commit3330fbbb3f62f072fa7e80102995b3012e0e552d (patch)
tree684afe07351a6454c739dcb5b8a0c6450117b1e2 /otr/dllmain.cpp
parent389f409a4b7c4243435ffdd11e39f225965a5a61 (diff)
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
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r--otr/dllmain.cpp13
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