diff --git a/src/windows/MessageList.cpp b/src/windows/MessageList.cpp index ab2ab6a6..08c34607 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; @@ -3329,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()); @@ -3672,15 +3682,16 @@ 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; 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); + bool mayReply = (!isActionMessage || IsReplyableActionMessage(pRCMsg->m_msg->m_type)) && maySendMessages; #ifdef OLD_WINDOWS EnableMenuItem(menu, ID_DUMMYPOPUP_DELETEMESSAGE, mayDelete ? MF_ENABLED : MF_GRAYED);