From 65500085ce3dc3fef72784d4aeda196169316be1 Mon Sep 17 00:00:00 2001 From: borkra Date: Fri, 10 Aug 2007 01:21:42 +0000 Subject: Added support for Unicode status messages git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@324 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/message_pump.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'tipper/message_pump.cpp') diff --git a/tipper/message_pump.cpp b/tipper/message_pump.cpp index 6738b96..6f9f18a 100644 --- a/tipper/message_pump.cpp +++ b/tipper/message_pump.cpp @@ -145,7 +145,7 @@ int ShowTipW(WPARAM wParam, LPARAM lParam) { clcit2->text = 0; if(wParam) { // wParam is char pointer containing text - e.g. status bar tooltip - clcit2->text = _tcsdup((TCHAR *)wParam); + clcit2->text = _tcsdup((TCHAR *)wParam); GetCursorPos(&clcit2->ptCursor); } @@ -162,8 +162,22 @@ int HideTip(WPARAM wParam, LPARAM lParam) { int ProtoAck(WPARAM wParam, LPARAM lParam) { ACKDATA *ack = (ACKDATA *)lParam; char *szMsg = (char *)ack->lParam; - if(ack->type == ACKTYPE_AWAYMSG && ack->result == ACKRESULT_SUCCESS && szMsg && szMsg[0]) { - PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)a2t(szMsg)); + if(ack->type == ACKTYPE_AWAYMSG && ack->result == ACKRESULT_SUCCESS) + { +#ifdef _UNICODE + DBVARIANT dbv; + bool unicode = !DBGetContactSetting(dat->hContact, "CList", "StatusMsg", &dbv) && + (dbv.type == DBVT_UTF8 || dbv.type == DBVT_WCHAR); + DBFreeVariant(&dbv); + if (unicode) { + DBGetContactSettingWString(dat->hContact, "CList", "StatusMsg", &dbv); + PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)_wcsdup(dbv.pwszVal)); + DBFreeVariant(&dbv); + } + else +#endif + if (szMsg && szMsg[0]) + PostMPMessage(MUM_GOTSTATUS, (WPARAM)ack->hContact, (LPARAM)a2t(szMsg)); } return 0; } -- cgit v1.2.3