From be7ad39fd756083ecc54564f852933c7b547254f Mon Sep 17 00:00:00 2001 From: Benjamin Jemlich Date: Sun, 5 Dec 2010 03:35:10 +0100 Subject: [PATCH] Fix updateMenuPermissions() after context menu change --- src/mumble/MainWindow.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mumble/MainWindow.cpp b/src/mumble/MainWindow.cpp index f94d72b0f..0b74ee5f4 100644 --- a/src/mumble/MainWindow.cpp +++ b/src/mumble/MainWindow.cpp @@ -1686,8 +1686,19 @@ void MainWindow::on_qaChannelSendMessage_triggered() { } void MainWindow::updateMenuPermissions() { - ClientUser *cu = getContextMenuUser(); - Channel *c = g.uiSession ? (cu ? cu->cChannel : getContextMenuChannel()) : NULL; + ClientUser *cu = NULL; + Channel *c = NULL; + + if (g.uiSession) { + cu = getContextMenuUser(); + if (!cu) + cu = pmModel->getUser(qtvUsers->currentIndex()); + + c = cu ? cu->cChannel : getContextMenuChannel(); + if (!c) + c = pmModel->getChannel(qtvUsers->currentIndex()); + } + ChanACL::Permissions p = static_cast(c ? c->uiPermissions : ChanACL::None); if (c && ! p) {