Fix wrong message length check (#5041)

This commit is contained in:
BoomEaro 2022-08-09 00:53:59 +03:00 committed by GitHub
parent 422f25af8b
commit ee7c1b1cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,7 @@ public abstract class AbstractChatHandler {
format = format.replace("{9}", nickname == null ? username : nickname); format = format.replace("{9}", nickname == null ? username : nickname);
// Local, shout and question chat types are only enabled when there's a valid radius // Local, shout and question chat types are only enabled when there's a valid radius
if (chat.getRadius() > 0 && event.getMessage().length() > 1) { if (chat.getRadius() > 0 && event.getMessage().length() > 0) {
if (chat.getType().isEmpty()) { if (chat.getType().isEmpty()) {
if (user.isToggleShout() && event.getMessage().charAt(0) == ess.getSettings().getChatShout()) { if (user.isToggleShout() && event.getMessage().charAt(0) == ess.getSettings().getChatShout()) {
event.setMessage(event.getMessage().substring(1)); event.setMessage(event.getMessage().substring(1));
@ -139,7 +139,7 @@ public abstract class AbstractChatHandler {
final User user = chat.getUser(); final User user = chat.getUser();
if (event.getMessage().length() > 1) { if (event.getMessage().length() > 0) {
if (chat.getType().isEmpty()) { if (chat.getType().isEmpty()) {
if (!user.isAuthorized("essentials.chat.local")) { if (!user.isAuthorized("essentials.chat.local")) {
user.sendMessage(tl("notAllowedToLocal")); user.sendMessage(tl("notAllowedToLocal"));