summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/history_menus.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-11-14 12:57:15 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-11-14 12:57:15 +0300
commit02dc4b49ff1d2384ddca4c50e87148235bb9efc7 (patch)
tree02eb89c87bc8a4271dce5f3c527de36a07e9eb19 /plugins/NewStory/src/history_menus.cpp
parent9d45fb3bd79a2d81d8d95b2ee50c1d1a74e14b54 (diff)
fixes #3920 (NewStory: отсутствует возможность попасть в меню комнаты, если в чате нет истории)
Diffstat (limited to 'plugins/NewStory/src/history_menus.cpp')
-rw-r--r--plugins/NewStory/src/history_menus.cpp34
1 files changed, 21 insertions, 13 deletions
diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp
index b82194ce3b..48d747b0f1 100644
--- a/plugins/NewStory/src/history_menus.cpp
+++ b/plugins/NewStory/src/history_menus.cpp
@@ -33,27 +33,35 @@ static HGENMENU hmiEdit, hmiBookmark, hmiDelete;
HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
{
- if (item->m_bOfflineFile) {
- Menu_ModifyItem(hmiCopyUrl, (item->m_bOfflineDownloaded) ? TranslateT("Copy file path") : TranslateT("Copy URL"));
- Menu_ShowItem(hmiCopyUrl, true);
- Menu_ShowItem(hmiSaveAs, true);
- Menu_ShowItem(hmiDownload, !item->m_bOfflineDownloaded);
+ Menu_ShowItem(hmiQuote, data->pMsgDlg != nullptr);
+ Menu_ShowItem(hmiSaveAs, false);
+ Menu_ShowItem(hmiCopyUrl, false);
+ Menu_ShowItem(hmiDownload, false);
+
+ bool bShowEventActions;
+ if (item != nullptr) {
+ if (item->m_bOfflineFile) {
+ Menu_ModifyItem(hmiCopyUrl, (item->m_bOfflineDownloaded) ? TranslateT("Copy file path") : TranslateT("Copy URL"));
+ Menu_ShowItem(hmiCopyUrl, true);
+ Menu_ShowItem(hmiSaveAs, true);
+ Menu_ShowItem(hmiDownload, !item->m_bOfflineDownloaded);
+ }
+
+ bShowEventActions = item->hEvent != 0;
+
+ NotifyEventHooks(hEventPreBuildMenu, item->hContact, (LPARAM)&item->dbe);
}
else {
- Menu_ShowItem(hmiCopyUrl, false);
- Menu_ShowItem(hmiSaveAs, false);
- Menu_ShowItem(hmiDownload, false);
- }
+ bShowEventActions = false;
- Menu_ShowItem(hmiQuote, data->pMsgDlg != nullptr);
+ DB::EventInfo dbei;
+ NotifyEventHooks(hEventPreBuildMenu, 0, (LPARAM)&dbei);
+ }
- bool bShowEventActions = item->hEvent != 0;
Menu_ShowItem(hmiEdit, bShowEventActions);
Menu_ShowItem(hmiDelete, bShowEventActions);
Menu_ShowItem(hmiBookmark, bShowEventActions);
- NotifyEventHooks(hEventPreBuildMenu, item->hContact, (LPARAM)&item->dbe);
-
HMENU hMenu = CreatePopupMenu();
Menu_Build(hMenu, hMenuObject);
return hMenu;