1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Only allow players with shout to chat

Fix regression of commit

5e507c9829 "Add server side ncurses terminal"

which allowed all players, even those without a shout priv, to chat.

Fixes #3362.
This commit is contained in:
est31 2015-11-13 01:35:54 +01:00
parent 36855522a5
commit 657a16d90c
3 changed files with 14 additions and 6 deletions

View file

@ -1063,7 +1063,8 @@ void Server::handleCommand_ChatMessage(NetworkPacket* pkt)
std::string name = player->getName();
std::wstring wname = narrow_to_wide(name);
std::wstring answer_to_sender = handleChat(name, wname, message, pkt->getPeerId());
std::wstring answer_to_sender = handleChat(name, wname, message,
true, pkt->getPeerId());
if (!answer_to_sender.empty()) {
// Send the answer to sender
SendChatMessage(pkt->getPeerId(), answer_to_sender);