diff options
author | Robert Adam <dev@robert-adam.de> | 2020-03-25 21:28:54 +0300 |
---|---|---|
committer | Robert Adam <dev@robert-adam.de> | 2020-04-16 10:29:49 +0300 |
commit | 8aadee917dea7a256b283585d14e1d0f0080fe27 (patch) | |
tree | c2282077f09b1083535ea1ed07439c52288b33d8 /src/mumble/ACLEditor.cpp | |
parent | dcd5842008ff3123484edffc84d619a559824334 (diff) |
Feature: Channel Listeners
This implements #3319 by allowing users to "listen" to a channel they
have not joined. Doing so will place a "listener proxy" (in other
software this is sometimes known as a "phantom") in that channel which
will look like a normal user except that it'll have the same name as the
user listening to that channel and an ear-icon instead of the normal
avatar-icon. It will also always show a muted-icon next to it.
If a listener proxy is in a channel, the server will route all audio
packets from that channel to the user the proxy belongs to (as if that
user was in the channel). Note though that the opposite of this is not
true: The users in the channel will not hear audio from the listening
user unless that user decides to join the channel.
Furthermore it is possible to set a local volume adjustment for each
individual proxy that will be applied to all audio that is received
through it.
Diffstat (limited to 'src/mumble/ACLEditor.cpp')
-rw-r--r-- | src/mumble/ACLEditor.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/mumble/ACLEditor.cpp b/src/mumble/ACLEditor.cpp index d17504bbc..b93ee2855 100644 --- a/src/mumble/ACLEditor.cpp +++ b/src/mumble/ACLEditor.cpp @@ -159,7 +159,7 @@ ACLEditor::ACLEditor(int channelid, const MumbleProto::ACL &mea, QWidget *p) : Q def->bInherited = true; def->iUserId = -1; def->qsGroup = QLatin1String("all"); - def->pAllow = ChanACL::Traverse | ChanACL::Enter | ChanACL::Speak | ChanACL::Whisper | ChanACL::TextMessage; + def->pAllow = ChanACL::Traverse | ChanACL::Enter | ChanACL::Speak | ChanACL::Whisper | ChanACL::TextMessage | ChanACL::Listen; def->pDeny = (~def->pAllow) & ChanACL::All; qlACLs << def; @@ -845,6 +845,7 @@ void ACLEditor::ACLPermissions_clicked() { int denied = 0; bool enabled = true; + bool modifiedEnter = false; for (int idx = 0; idx < qlACLAllow.count(); idx++) { ChanACL::Perm p = qlPerms[idx]; if (qlACLAllow[idx]->isChecked() && qlACLDeny[idx]->isChecked()) { @@ -854,6 +855,32 @@ void ACLEditor::ACLPermissions_clicked() { qlACLAllow[idx]->setChecked(false); } + if (p == ChanACL::Enter + && (source == qlACLAllow[idx] || source == qlACLDeny[idx])) { + // Unchecking a checkbox is not counted as modifying the Enter privilege + // in this context + modifiedEnter = source->isChecked(); + } + + if (p == ChanACL::Listen && modifiedEnter) { + // If Enter privileges are granted, also grant Listen privilege + // and vice versa. + // This is to make sure that people don't accidentally forget to + // modify the Listen permission when they modify the enter permission. + // Especially in the case of denying enter, this could potentially lead + // to confusion if people were still able to listen to a channel they can't + // enter. + // However the user still can allow/deny the Listen permission manually after + // having changed the enter permission. + if (denied & ChanACL::Enter) { + qlACLAllow[idx]->setChecked(false); + qlACLDeny[idx]->setChecked(true); + } else { + qlACLAllow[idx]->setChecked(true); + qlACLDeny[idx]->setChecked(false); + } + } + qlACLAllow[idx]->setEnabled(enabled || p == ChanACL::Speak); qlACLDeny[idx]->setEnabled(enabled || p == ChanACL::Speak); |