diff options
Diffstat (limited to 'plugins/NewStory/src/history_control.cpp')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index a965e7eb81..a616e9a6b7 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -37,6 +37,7 @@ struct NewstoryListData : public MZeroedObject HWND hwndEditBox; CTimer redrawTimer; + CSrmmBaseDialog *pMsgDlg = nullptr; void OnContextMenu(int index, POINT pt) { @@ -46,8 +47,18 @@ struct NewstoryListData : public MZeroedObject HMENU hMenu = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CONTEXTMENU)); TranslateMenu(hMenu); - - int ret = TrackPopupMenu(GetSubMenu(hMenu, 0), TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr); + + HMENU hSubMenu = GetSubMenu(hMenu, 0); + UINT ret; + if (pMsgDlg != nullptr && pMsgDlg->isChat()) { + EnableMenuItem(hSubMenu, 2, MF_BYPOSITION | MF_GRAYED); + + pMsgDlg->m_bInMenu = true; + ret = Chat_CreateMenu(hwnd, hSubMenu, pt, pMsgDlg->getChat(), nullptr); + pMsgDlg->m_bInMenu = false; + } + else ret = TrackPopupMenu(hSubMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr); + switch(ret) { case ID_CONTEXT_COPY: SendMessage(hwnd, NSM_COPY, 0, 0); @@ -63,6 +74,12 @@ struct NewstoryListData : public MZeroedObject case ID_CONTEXT_SELECTALL: SendMessage(hwnd, NSM_SELECTITEMS, 0, items.getCount() - 1); break; + + default: + if (pMsgDlg != nullptr) { + PostMessage(pMsgDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); + Chat_DoEventHook(pMsgDlg->getChat(), GC_USER_LOGMENU, nullptr, nullptr, ret); + } } DestroyMenu(hMenu); @@ -660,6 +677,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(hwnd, NSM_SETCARET, data->items.getCount() - 1, 1); break; + case NSM_SET_SRMM: + data->pMsgDlg = (CSrmmBaseDialog *)lParam; + break; + case NSM_DELETE: if (IDYES == MessageBoxW(hwnd, TranslateW(wszDelete), _T(MODULETITLE), MB_YESNOCANCEL | MB_ICONQUESTION)) { db_set_safety_mode(false); |