summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/chat
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2012-07-23 18:40:18 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2012-07-23 18:40:18 +0000
commit5c794a21c8e0c943e69b08a9ba52064149d663a6 (patch)
tree84eeabfea043d185fe349e29a551e0678913ef5a /plugins/TabSRMM/chat
parentbae46e23df15573407254315781431ce213e7d8b (diff)
unicode URLs
git-svn-id: http://svn.miranda-ng.org/main/trunk@1134 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/chat')
-rw-r--r--plugins/TabSRMM/chat/window.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/plugins/TabSRMM/chat/window.cpp b/plugins/TabSRMM/chat/window.cpp
index cffaa6ba0b..38274b5d25 100644
--- a/plugins/TabSRMM/chat/window.cpp
+++ b/plugins/TabSRMM/chat/window.cpp
@@ -2860,20 +2860,20 @@ LABEL_SHOWWINDOW:
break;
case ID_SEARCH_GOOGLE: {
- char szURL[4096];
+ TCHAR szURL[4096];
if (pszWord[0]) {
- mir_snprintf(szURL, sizeof(szURL), "http://www.google.com/search?q=" TCHAR_STR_PARAM, pszWord);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM) szURL);
+ mir_sntprintf(szURL, SIZEOF(szURL), _T("http://www.google.com/search?q=%s"), pszWord);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW|OUF_TCHAR, (LPARAM) szURL);
}
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
}
break;
case ID_SEARCH_WIKIPEDIA: {
- char szURL[4096];
+ TCHAR szURL[4096];
if (pszWord[0]) {
- mir_snprintf(szURL, sizeof(szURL), "http://en.wikipedia.org/wiki/" TCHAR_STR_PARAM, pszWord);
- CallService(MS_UTILS_OPENURL, 1, (LPARAM) szURL);
+ mir_sntprintf(szURL, SIZEOF(szURL), _T("http://en.wikipedia.org/wiki/%s"), pszWord);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW|OUF_TCHAR, (LPARAM) szURL);
}
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
}
@@ -2938,7 +2938,6 @@ LABEL_SHOWWINDOW:
isLink = IsStringValidLink(tr.lpstrText);
if (isLink) {
- char* pszUrl = t2a(tr.lpstrText, 0);
if (((ENLINK *) lParam)->msg == WM_RBUTTONDOWN) {
HMENU hSubMenu;
POINT pt;
@@ -2950,17 +2949,16 @@ LABEL_SHOWWINDOW:
ClientToScreen(((NMHDR *) lParam)->hwndFrom, &pt);
switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL)) {
case ID_NEW:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM) pszUrl);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW|OUF_TCHAR, (LPARAM) tr.lpstrText);
break;
case ID_CURR:
- CallService(MS_UTILS_OPENURL, 0, (LPARAM) pszUrl);
+ CallService(MS_UTILS_OPENURL, OUF_TCHAR, (LPARAM) tr.lpstrText);
break;
case ID_COPY: {
- HGLOBAL hData;
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (lstrlen(tr.lpstrText) + 1));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (lstrlen(tr.lpstrText) + 1));
lstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
@@ -2970,13 +2968,11 @@ LABEL_SHOWWINDOW:
break;
}
mir_free(tr.lpstrText);
- mir_free(pszUrl);
return TRUE;
} else if (((ENLINK *) lParam)->msg == WM_LBUTTONUP) {
- CallService(MS_UTILS_OPENURL, 1, (LPARAM) pszUrl);
+ CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW|OUF_TCHAR, (LPARAM) tr.lpstrText);
SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
mir_free(tr.lpstrText);
- mir_free(pszUrl);
return TRUE;
}
} else if (g_Settings.ClickableNicks) { // clicked a nick name