diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-10 18:52:02 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-10 18:52:06 +0300 |
commit | 07feb451bf28c855a383b395d1d27eb6e2558b66 (patch) | |
tree | 2c4ab0997d23d0ee91e25bd38dea3fb49b159209 /protocols/VKontakte/src | |
parent | 83d9bcd403cc96cd82059d0e990d207f795343a7 (diff) |
fixes #4039 (NewStory: Forward из чата с пустым журналом приводит к падению)
Diffstat (limited to 'protocols/VKontakte/src')
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index ca6df00340..372e8690a8 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -415,9 +415,10 @@ int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM) return 0;
}
-int CVkProto::OnPrebuildNSMenu(WPARAM, LPARAM)
+int CVkProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM lParam)
{
- Menu_ShowItem(m_hNewStoryMenuItems[NSMI_FORWARD], true);
+ auto &dbei = *(DB::EventInfo *)lParam;
+ Menu_ShowItem(m_hNewStoryMenuItems[NSMI_FORWARD], hContact != 0 && dbei);
return 0;
}
@@ -431,6 +432,9 @@ INT_PTR CVkProto::SvcNSExecMenu(WPARAM iCommand, LPARAM pHandle) case NSMI_FORWARD:
{
std::vector<MEVENT> vIds = NS_GetSelection(HANDLE(pHandle));
+ if (vIds.empty())
+ break;
+
wchar_t wszMsg[2048] = L"";
if (auto *pDlg = NS_GetSrmm((HANDLE)pHandle))
GetWindowText(pDlg->GetInput(), wszMsg, 2048);
|