diff options
author | borkra <borkra@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-08-10 01:21:42 +0000 |
---|---|---|
committer | borkra <borkra@4f64403b-2f21-0410-a795-97e2b3489a10> | 2007-08-10 01:21:42 +0000 |
commit | 65500085ce3dc3fef72784d4aeda196169316be1 (patch) | |
tree | 938ac75a8d50787aee7eb8820715c50cf878ad7d /tipper/message_pump.cpp | |
parent | 722122ecf55ca4f403c64f90df58c89fae92a25e (diff) |
Added support for Unicode status messages
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@324 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'tipper/message_pump.cpp')
-rw-r--r-- | tipper/message_pump.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
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;
}
|