diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-19 14:23:08 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-19 14:23:08 +0000 |
commit | 797b7efe9a86a2ff4e7e4ecfc2219b633f10faa4 (patch) | |
tree | 6b8bf4ba3e2a80ab9c4826790847baeb1fea8b01 /plugins/Scriver/src/msgs.cpp | |
parent | 6be9b9c1dd00da5ecd33cbc20ece4162ba56c402 (diff) |
- 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
Diffstat (limited to 'plugins/Scriver/src/msgs.cpp')
-rw-r--r-- | plugins/Scriver/src/msgs.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
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);
|