From 9748812df68d15ddae276d3a2ba38c702af70f34 Mon Sep 17 00:00:00 2001 From: ZyroX <79484310+okzyrox@users.noreply.github.com> Date: Fri, 30 Jan 2026 01:02:18 +0000 Subject: [PATCH 1/2] Hide "Reply" message popup if user cannot send messages (also check's again when it's clicked) --- src/windows/MessageList.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/windows/MessageList.cpp b/src/windows/MessageList.cpp index ab2ab6a6..38d08f83 100644 --- a/src/windows/MessageList.cpp +++ b/src/windows/MessageList.cpp @@ -3317,6 +3317,13 @@ void MessageList::HandleRightClickMenuCommand(int command) } case ID_DUMMYPOPUP_REPLY: { + Channel* pChan = GetDiscordInstance()->GetCurrentChannel(); + if (!pChan) + break; + + if (!pChan->HasPermission(PERM_SEND_MESSAGES)) + break; + Snowflake sf[2]; sf[0] = pMsg->m_msg->m_snowflake; sf[1] = pMsg->m_msg->m_author_snowflake; @@ -3672,6 +3679,7 @@ LRESULT CALLBACK MessageList::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA bool isThisMyMessage = pRCMsg->m_msg->m_author_snowflake == ourPf->m_snowflake; bool mayManageMessages = pChan->HasPermission(PERM_MANAGE_MESSAGES); + bool maySendMessages = pChan->HasPermission(PERM_SEND_MESSAGES); bool isActionMessage = IsActionMessage(pRCMsg->m_msg->m_type) || IsClientSideMessage(pRCMsg->m_msg->m_type); bool isForward = pRCMsg->m_msg->m_bIsForward; @@ -3680,7 +3688,7 @@ LRESULT CALLBACK MessageList::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA bool mayEdit = isThisMyMessage && !isForward && !isActionMessage; bool mayPin = mayManageMessages; bool maySpeak = !isActionMessage && !pRCMsg->m_msg->m_message.empty(); - bool mayReply = !isActionMessage || IsReplyableActionMessage(pRCMsg->m_msg->m_type); + bool mayReply = (!isActionMessage || IsReplyableActionMessage(pRCMsg->m_msg->m_type)) && maySendMessages; #ifdef OLD_WINDOWS EnableMenuItem(menu, ID_DUMMYPOPUP_DELETEMESSAGE, mayDelete ? MF_ENABLED : MF_GRAYED); From d7837f5ce453d2d9d78f23f7b66dd1c0c7ff4104 Mon Sep 17 00:00:00 2001 From: ZyroX <79484310+okzyrox@users.noreply.github.com> Date: Fri, 30 Jan 2026 16:17:17 +0000 Subject: [PATCH 2/2] Hide "Edit" without permissions --- src/windows/MessageList.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/windows/MessageList.cpp b/src/windows/MessageList.cpp index 38d08f83..08c34607 100644 --- a/src/windows/MessageList.cpp +++ b/src/windows/MessageList.cpp @@ -3336,6 +3336,9 @@ void MessageList::HandleRightClickMenuCommand(int command) if (!pChan) break; + if (!pChan->HasPermission(PERM_SEND_MESSAGES)) + break; + static char buffer[8192]; snprintf(buffer, sizeof buffer, TmGetString(IDS_CONFIRM_PIN).c_str(), pChan->m_name.c_str(), pMsg->m_msg->m_author.c_str(), pMsg->m_msg->m_dateFull.c_str(), pMsg->m_msg->m_message.c_str()); @@ -3685,7 +3688,7 @@ LRESULT CALLBACK MessageList::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA bool mayCopy = !isForward && !isActionMessage; bool mayDelete = isThisMyMessage || mayManageMessages; - bool mayEdit = isThisMyMessage && !isForward && !isActionMessage; + bool mayEdit = isThisMyMessage && !isForward && !isActionMessage && maySendMessages; bool mayPin = mayManageMessages; bool maySpeak = !isActionMessage && !pRCMsg->m_msg->m_message.empty(); bool mayReply = (!isActionMessage || IsReplyableActionMessage(pRCMsg->m_msg->m_type)) && maySendMessages;