aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 52eb97608..179147637 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -2880,12 +2880,15 @@ void Server::handleChatInterfaceEvent(ChatEvent *evt)
}
std::wstring Server::handleChat(const std::string &name, const std::wstring &wname,
- const std::wstring &wmessage, bool check_shout_priv, RemotePlayer *player)
+ std::wstring wmessage, bool check_shout_priv, RemotePlayer *player)
{
// If something goes wrong, this player is to blame
RollbackScopeActor rollback_scope(m_rollback,
std::string("player:") + name);
+ if (g_settings->getBool("strip_color_codes"))
+ wmessage = unescape_enriched(wmessage);
+
if (player) {
switch (player->canSendChatMessage()) {
case RPLAYER_CHATRESULT_FLOODING: {
@@ -2940,7 +2943,7 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
/*
Send the message to others
*/
- actionstream << "CHAT: " << wide_to_narrow(line) << std::endl;
+ actionstream << "CHAT: " << wide_to_narrow(unescape_enriched(line)) << std::endl;
std::vector<u16> clients = m_clients.getClientIDs();