forked from Mirrorlandia_minetest/minetest
Server: Ignore whitespace-only chat messages
This commit is contained in:
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";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user