summaryrefslogtreecommitdiff
path: root/plugins/WebView/src/webview_alerts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-28 19:14:24 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-28 19:14:24 +0000
commit28412b4c61183eb1b33adeee5dbc8e9cefc92d9f (patch)
tree4becbf91e50b6b5fca0b600c26b2dc2a72a279c1 /plugins/WebView/src/webview_alerts.cpp
parent2bf7e3ba50b1bf547c726523cf842e9263d5db18 (diff)
varioius minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@5517 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WebView/src/webview_alerts.cpp')
-rw-r--r--plugins/WebView/src/webview_alerts.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp
index fb2e287127..141a3c3251 100644
--- a/plugins/WebView/src/webview_alerts.cpp
+++ b/plugins/WebView/src/webview_alerts.cpp
@@ -220,28 +220,30 @@ int OSDAlert(WPARAM wParam, LPARAM lParam)
/*****************************************************************************/
int ErrorMsgs(WPARAM wParam, LPARAM lParam)
{
- char newdisplaytext[2000];
- char *contactname = (char*)wParam, *displaytext = (char*)lParam;
+ HANDLE hContact = (HANDLE)wParam;
+ TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam;
- if ( !db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0)) {
- if ((ServiceExists(MS_POPUP_ADDPOPUP) != 0) && ((db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)))) {
- _snprintf(newdisplaytext, sizeof(newdisplaytext), "%s\n%s", contactname, displaytext);
- PUShowMessage(newdisplaytext, SM_WARNING);
- }
- else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
- _snprintf(newdisplaytext, sizeof(newdisplaytext), "%s: %s", contactname, Translate(displaytext));
- CallService("OSD/Announce", (WPARAM) newdisplaytext, 0);
- }
- else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
- MIRANDASYSTRAYNOTIFY webview_tip = {0};
- webview_tip.cbSize = sizeof(MIRANDASYSTRAYNOTIFY);
- webview_tip.szProto = NULL;
- webview_tip.szInfoTitle = contactname;
- webview_tip.szInfo = Translate(displaytext);
- webview_tip.dwInfoFlags = NIIF_ERROR;
- webview_tip.uTimeout = 15000;
- CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM) &webview_tip);
- }
+ if ( db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0))
+ return 0;
+
+ TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0);
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
+ mir_sntprintf(newdisplaytext, SIZEOF(newdisplaytext), _T("%s\n%s"), ptszContactName, displaytext);
+ PUShowMessageT(newdisplaytext, SM_WARNING);
+ }
+ else if ( ServiceExists("OSD/Announce") && db_get_b(NULL, MODULENAME, ERROR_POPUP_KEY, 0)) {
+ mir_sntprintf(newdisplaytext, SIZEOF(newdisplaytext), _T("%s: %s"), ptszContactName, TranslateTS(displaytext));
+ CallService("OSD/Announce", (WPARAM)newdisplaytext, 0);
+ }
+ else if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
+ MIRANDASYSTRAYNOTIFY webview_tip = {0};
+ webview_tip.cbSize = sizeof(MIRANDASYSTRAYNOTIFY);
+ webview_tip.szProto = NULL;
+ webview_tip.tszInfoTitle = ptszContactName;
+ webview_tip.tszInfo = TranslateTS(displaytext);
+ webview_tip.dwInfoFlags = NIIF_ERROR | NIIF_INTERN_UNICODE;
+ webview_tip.uTimeout = 15000;
+ CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM) &webview_tip);
}
return 0;
}