summaryrefslogtreecommitdiff
path: root/otr/dllmain.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-29 14:19:25 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-07-29 14:19:25 +0000
commit2d5acb9afe2fe861f7af1cdd7349056c97173ced (patch)
tree6bac40f2960e64e89f96ad918fe95cd2179a859f /otr/dllmain.cpp
parent8d2322e9200357df2fd873d385f99febad35effd (diff)
handle UTF messages
upgrade to libotr 3.1.0 git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@306 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'otr/dllmain.cpp')
-rw-r--r--otr/dllmain.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/otr/dllmain.cpp b/otr/dllmain.cpp
index 26300bb..b6291cf 100644
--- a/otr/dllmain.cpp
+++ b/otr/dllmain.cpp
@@ -629,7 +629,9 @@ int OTRSendMessage(WPARAM wParam,LPARAM lParam){
//MessageBox(0, "Send message - converting to UTF-8", "msg", MB_OK);
- if(ccs->wParam & PREF_UNICODE) {
+ if(ccs->wParam & PREF_UTF) {
+ oldmessage_utf = strdup(oldmessage);
+ } else if(ccs->wParam & PREF_UNICODE) {
int size = WideCharToMultiByte(CP_UTF8, 0, (wchar_t *)&oldmessage[strlen(oldmessage)+1], -1, 0, 0, 0, 0);
oldmessage_utf = (char *)malloc(size);
if(!oldmessage_utf) return 1;
@@ -786,7 +788,9 @@ int RecvMessage(WPARAM wParam,LPARAM lParam){
if(!proto || !uname) return 1; // error
// convert oldmessage to utf-8
- if(ccs->wParam & PREF_UNICODE) {
+ if(ccs->wParam & PREF_UTF) {
+ oldmessage_utf = strdup(oldmessage);
+ } else if(ccs->wParam & PREF_UNICODE) {
int size = WideCharToMultiByte(CP_UTF8, 0, (wchar_t *)&oldmessage[strlen(oldmessage)+1], -1, 0, 0, 0, 0);
oldmessage_utf = (char *)malloc(size);
if(!oldmessage_utf) return 1;