summaryrefslogtreecommitdiff
path: root/plugins/Popup/src/popup_wnd2.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-12-27 17:19:20 +0300
commite1a3a426a742028570baaee7430b2b5750734e4c (patch)
treeed801bc7954fcd7c860c506d4f451a8bcb82e39b /plugins/Popup/src/popup_wnd2.cpp
parent3ae8bfcab00ae1b497b8c1c61d6dcf4bf7322e06 (diff)
obsolete structure ADDCONTACTSTRUCT, service MS_ADDCONTACT_SHOW and whole m_addcontact.h removed and replaced with Contact_Add* functions
Diffstat (limited to 'plugins/Popup/src/popup_wnd2.cpp')
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index a3d5c3c425..fada19920f 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -545,9 +545,9 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
{
bool isIm = (m_hContact && (CallProtoService(GetContactProto(m_hContact), PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IM)) ? true : false;
- bool enableDefaultGen = (m_hContact || !(PopupOptions.actions&ACT_DEF_NOGLOBAL)) ? true : false;
- bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions&ACT_DEF_IMONLY)) ? true : false;
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool enableDefaultGen = (m_hContact || !(PopupOptions.actions & ACT_DEF_NOGLOBAL)) ? true : false;
+ bool enableDefaultUsr = (isIm || m_hContact && !(PopupOptions.actions & ACT_DEF_IMONLY)) ? true : false;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
if (PopupOptions.actions & ACT_ENABLE) {
if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) ++m_actionCount;
@@ -857,7 +857,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_DESTROY:
PopupThreadUnlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(dat->hwndPopup);
SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)dat->oldWndProc);
SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
@@ -908,7 +908,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
switch (lParam) {
case ACT_DEF_MESSAGE:
CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -936,7 +936,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case ACT_DEF_DETAILS:
CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)m_hContact, 0);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
@@ -946,15 +946,9 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
break;
case ACT_DEF_ADD:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = nullptr;
- CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- }
+ Contact_Add(m_hContact);
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
break;
case ACT_DEF_PIN:
@@ -965,7 +959,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
m_bIsPinned = !m_bIsPinned;
{
- bool iconSize = PopupOptions.actions&ACT_LARGE ? TRUE : FALSE;
+ bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? LoadIconEx(IDI_ACT_PINNED, iconSize) : LoadIconEx(IDI_ACT_PIN, iconSize));
}
break;
@@ -1011,7 +1005,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case UM_MENUDONE:
{
unlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ if (!(PopupOptions.actions & ACT_DEF_KEEPWND))
PUDeletePopup(m_hwnd);
break;
}