Server: Ignore whitespace-only chat messages

This commit is contained in:
SmallJoker 2021-06-21 19:04:25 +02:00
parent b5c09ada79
commit a8b7c8ff38

@ -3001,6 +3001,9 @@ std::wstring Server::handleChat(const std::string &name,
} }
auto message = trim(wide_to_utf8(wmessage)); auto message = trim(wide_to_utf8(wmessage));
if (message.empty())
return L"";
if (message.find_first_of("\n\r") != std::wstring::npos) { if (message.find_first_of("\n\r") != std::wstring::npos) {
return L"Newlines are not permitted in chat messages"; return L"Newlines are not permitted in chat messages";
} }