Skip to content

Commit

Permalink
Enable edit menuentry if write on parent (sync with server permission…
Browse files Browse the repository at this point in the history
…s), and fix speex compile bug
  • Loading branch information
thorvald committed Oct 25, 2009
1 parent 6a4a2b6 commit 62b1536
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion speexbuild/speex.def
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
;
; speex.def
;
LIBRARY speexdsp
LIBRARY speex
EXPORTS
;
;
Expand Down
17 changes: 16 additions & 1 deletion src/mumble/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,21 @@ void MainWindow::updateMenuPermissions() {
c->uiPermissions = p;
}

Channel *cparent = c ? c->cParent : NULL;
ChanACL::Permissions pparent = static_cast<ChanACL::Permissions>(cparent ? cparent->uiPermissions : ChanACL::None);

if (cparent && ! pparent) {
MumbleProto::PermissionQuery mppq;
mppq.set_channel_id(cparent->iId);
g.sh->sendMessage(mppq);
if (cparent->iId == 0)
pparent = g.pPermissions;
else
pparent = ChanACL::All;

cparent->uiPermissions = pparent;
}

ClientUser *user = g.uiSession ? ClientUser::get(g.uiSession) : NULL;
Channel *homec = user ? user->cChannel : NULL;
ChanACL::Permissions homep = static_cast<ChanACL::Permissions>(homec ? homec->uiPermissions : ChanACL::None);
Expand All @@ -1327,7 +1342,7 @@ void MainWindow::updateMenuPermissions() {

qaChannelAdd->setEnabled(p & (ChanACL::Write | ChanACL::MakeChannel | ChanACL::MakeTempChannel));
qaChannelRemove->setEnabled(p & ChanACL::Write);
qaChannelACL->setEnabled(p & ChanACL::Write);
qaChannelACL->setEnabled((p & ChanACL::Write) || (pparent & ChanACL::Write));

qaChannelLink->setEnabled((p & (ChanACL::Write | ChanACL::LinkChannel)) && (homep & (ChanACL::Write | ChanACL::LinkChannel)));
qaChannelUnlink->setEnabled((p & (ChanACL::Write | ChanACL::LinkChannel)) || (homep & (ChanACL::Write | ChanACL::LinkChannel)));
Expand Down

0 comments on commit 62b1536

Please sign in to comment.