Skip to content

Commit

Permalink
src/murmur/Messages.cpp: Warn older clients about ChannelListener fea…
Browse files Browse the repository at this point in the history
…ture

ChannelListener will be introduced with Mumble 1.4.0 but older clients
will not know what these are. Thus they won't show them in their UI
which could lead to users being listened to without noticing.

In order to solve this issue, this commit implements a logic on the
Server that'll inform older clients about this possibility by sending
them a TextMessage right after they have authenticated (and after they
have received the server's welcome text).
  • Loading branch information
Krzmbrzl committed Apr 22, 2020
1 parent 97b3456 commit 45f4a80
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/murmur/Messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,27 @@ void Server::msgAuthenticate(ServerUser *uSource, MumbleProto::Authenticate &msg
sendMessage(uSource, mpsug);
}

if (uSource->uiVersion < 0x010400 && Meta::mp.iMaxListenersPerChannel > 0 && Meta::mp.iMaxListenerProxiesPerUser > 0) {
// The server has the ChannelListener feature enabled but the client that connects doesn't have version 1.4.0 or newer
// meaning that this client doesn't know what ChannelListeners are. Thus we'll send that user a text-message informing
// about this.
MumbleProto::TextMessage mptm;

QLatin1String msg();

if (Meta::mp.bAllowHTML) {
mptm.set_message("<b>[WARNING]</b>: This server has the <b>ChannelListener</b> feature enabled but your client version does not support it. "
"This means that users <b>might be listening to what you are saying in your channel without you noticing!</b> "
"You can solve this issue by upgrading to Mumble 1.4.0 or newer.");
} else {
mptm.set_message("[WARNING]: This server has the ChannelListener feature enabled but your client version does not support it. "
"This means that users might be listening to what you are saying in your channel without you noticing! "
"You can solve this issue by upgrading to Mumble 1.4.0 or newer.");
}

sendMessage(uSource, mptm);
}

log(uSource, "Authenticated");

emit userConnected(uSource);
Expand Down

0 comments on commit 45f4a80

Please sign in to comment.