summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/server.cpp b/src/server.cpp
index c93abb10c..f6faccb1f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2755,7 +2755,8 @@ void Server::handleChatInterfaceEvent(ChatEvent *evt)
}
std::wstring Server::handleChat(const std::string &name, const std::wstring &wname,
- const std::wstring &wmessage, u16 peer_id_to_avoid_sending)
+ const std::wstring &wmessage, bool check_shout_priv,
+ u16 peer_id_to_avoid_sending)
{
// If something goes wrong, this player is to blame
RollbackScopeActor rollback_scope(m_rollback,
@@ -2783,10 +2784,15 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
else
line += L"-!- Invalid command: " + str_split(wcmd, L' ')[0];
} else {
- line += L"<";
- line += wname;
- line += L"> ";
- line += wmessage;
+ if (check_shout_priv && !checkPriv(name, "shout")) {
+ line += L"-!- You don't have permission to shout.";
+ broadcast_line = false;
+ } else {
+ line += L"<";
+ line += wname;
+ line += L"> ";
+ line += wmessage;
+ }
}
/*