diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-07 14:42:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-07 14:42:57 +0300 |
commit | c4a013eb138c4fe3e181751ca5a5b596e5961dd4 (patch) | |
tree | dcd9c18e39aa8c19c049cab4aad7fdd5c21036fe /protocols/Telegram/src/menus.cpp | |
parent | f45c6111f5b86d327e30b3709c92321248534398 (diff) |
since Reply menu item does not depend on a protocol, it's moved to NewStory
Diffstat (limited to 'protocols/Telegram/src/menus.cpp')
-rw-r--r-- | protocols/Telegram/src/menus.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/protocols/Telegram/src/menus.cpp b/protocols/Telegram/src/menus.cpp index ac87355f29..ded59ff5ed 100644 --- a/protocols/Telegram/src/menus.cpp +++ b/protocols/Telegram/src/menus.cpp @@ -30,7 +30,7 @@ void CTelegramProto::InitMenus() CMenuItem mi(&g_plugin); mi.pszService = szServiceName; - mi.position = 10000000; + mi.position = NS_PROTO_MENU_POS; mi.hIcolibItem = g_plugin.getIconHandle(IDI_FORWARD); mi.name.a = LPGEN("Forward"); hmiForward = Menu_AddNewStoryMenuItem(&mi, 1); @@ -39,25 +39,16 @@ void CTelegramProto::InitMenus() mi.hIcolibItem = g_plugin.getIconHandle(IDI_REACTION); mi.name.a = LPGEN("Reaction"); hmiReaction = Menu_AddNewStoryMenuItem(&mi, 2); - - mi.position++; - mi.hIcolibItem = g_plugin.getIconHandle(IDI_REPLY); - mi.name.a = LPGEN("Reply"); - hmiReply = Menu_AddNewStoryMenuItem(&mi, 3); } -int CTelegramProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM lParam) +int CTelegramProto::OnPrebuildNSMenu(WPARAM hContact, LPARAM) { if (!Proto_IsProtoOnContact(hContact, m_szModuleName)) { Menu_ShowItem(hmiForward, false); Menu_ShowItem(hmiReaction, false); - Menu_ShowItem(hmiReply, false); } else { - auto *pDbei = (DB::EventInfo *)lParam; - - Menu_ShowItem(hmiForward, getByte("Protected")); - Menu_ShowItem(hmiReply, mir_strlen(pDbei->szId) > 0 && !Contact::IsReadonly(hContact)); + Menu_ShowItem(hmiForward, 0 == getByte(hContact, "Protected")); auto *pUser = FindUser(GetId(hContact)); Menu_ShowItem(hmiReaction, pUser && pUser->pReactions); @@ -195,12 +186,6 @@ INT_PTR CTelegramProto::SvcExecMenu(WPARAM iCommand, LPARAM pHandle) if (hCurrentEvent != -1) CReactionsDlg(this, hCurrentEvent).DoModal(); break; - - case 3: // reply - if (hCurrentEvent != -1) - if (auto *pDlg = NS_GetSrmm((HANDLE)pHandle)) - pDlg->SetQuoteEvent(hCurrentEvent); - break; } return 0; } |