From 797b7efe9a86a2ff4e7e4ecfc2219b633f10faa4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 19 Jul 2014 14:23:08 +0000 Subject: - scriver to open metacontact window upon receiving an event - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@9861 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/msgs.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/Scriver/src/msgs.cpp') diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index 5ae4dc4a2c..ec47078267 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -75,15 +75,14 @@ int IsAutoPopup(MCONTACT hContact) { static INT_PTR ReadMessageCommand(WPARAM wParam, LPARAM lParam) { - NewMessageWindowLParam newData = { 0 }; - HWND hwndExisting; - HWND hParent; + CLISTEVENT *pcle = (CLISTEVENT*)lParam; + MCONTACT hContact = db_mc_tryMeta(pcle->hContact); - hwndExisting = WindowList_Find(g_dat.hMessageWindowList, ((CLISTEVENT *) lParam)->hContact); + HWND hwndExisting = WindowList_Find(g_dat.hMessageWindowList, hContact); if (hwndExisting == NULL) { - newData.hContact = ((CLISTEVENT *) lParam)->hContact; - hParent = GetParentWindow(newData.hContact, FALSE); - CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)& newData); + NewMessageWindowLParam newData = { 0 }; + newData.hContact = hContact; + CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), GetParentWindow(hContact, FALSE), DlgProcMessage, (LPARAM)&newData); } else SendMessage(GetParent(hwndExisting), CM_POPUPWINDOW, 0, (LPARAM)hwndExisting); return 0; @@ -218,7 +217,7 @@ static int TypingMessage(WPARAM hContact, LPARAM lParam) tn.tszInfo = szTip; tn.dwInfoFlags = NIIF_INFO | NIIF_INTERN_UNICODE; tn.uTimeout = 1000 * 4; - CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& tn); + CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&tn); } else { CLISTEVENT cle = { sizeof(cle) }; @@ -279,13 +278,13 @@ static void RestoreUnreadMessageAlerts(void) newData.hContact = hContact; newData.flags = NMWLP_INCOMING; HWND hParent = GetParentWindow(newData.hContact, FALSE); - CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)& newData); + CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSG), hParent, DlgProcMessage, (LPARAM)&newData); } else { cle.hContact = hContact; cle.hDbEvent = hDbEvent; mir_sntprintf(toolTip, SIZEOF(toolTip), TranslateT("Message from %s"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR)); - CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)& cle); + CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); } } hDbEvent = db_event_next(hContact, hDbEvent); -- cgit v1.2.3