geforkt von SteamWar/BungeeCore
Fix empty messages
Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Ursprung
b80827ed1e
Commit
3053d5d301
@ -82,11 +82,10 @@ public class ChatListener extends BasicListener {
|
||||
}
|
||||
|
||||
public static void sendChat(ChatSender sender, Stream<ChatSender> receivers, String format, ChatSender msgReceiver, String message) {
|
||||
if(chatFilter(sender, message))
|
||||
return;
|
||||
|
||||
SteamwarUser user = sender.user();
|
||||
String coloredMessage = (user.getUserGroup() != UserGroup.Member || coloredTeams.contains(user.getTeam())) ? ChatColor.translateAlternateColorCodes('&', message) : message;
|
||||
final String coloredMessage = (user.getUserGroup() != UserGroup.Member || coloredTeams.contains(user.getTeam())) ? ChatColor.translateAlternateColorCodes('&', message) : message;
|
||||
if(chatFilter(sender, coloredMessage))
|
||||
return;
|
||||
|
||||
AtomicBoolean noReceiver = new AtomicBoolean(true);
|
||||
receivers.filter(ChatSender::chatShown).forEach(player -> {
|
||||
@ -132,6 +131,11 @@ public class ChatListener extends BasicListener {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(message.replace("§[a-f0-9klmno]", "").trim().isEmpty()) {
|
||||
sender.system("CHAT_EMPTY");
|
||||
return true;
|
||||
}
|
||||
|
||||
SteamwarUser user = sender.user();
|
||||
UserGroup group = user.getUserGroup();
|
||||
if(!group.isTeamGroup() && (message.contains("http:") || message.contains("https:") || message.contains("www."))){
|
||||
|
@ -521,6 +521,7 @@ CHAT_RECEIVE=§cTo be able to send chat messages, you must also receive them!
|
||||
CHAT_NO_LINKS=§cYou may not send links.
|
||||
CHAT_BC_USAGE=§8/§7bc §8[§emessage§8]
|
||||
CHAT_NO_RECEIVER=§cNobody receives your message
|
||||
CHAT_EMPTY=§cDon't write meaningless empty messages.
|
||||
|
||||
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
||||
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
||||
|
@ -500,6 +500,7 @@ CHAT_RECEIVE=§cUm Chatnachrichten versenden zu können, musst du auch welche em
|
||||
CHAT_NO_LINKS=§cDu darfst keine Links versenden.
|
||||
CHAT_BC_USAGE=§8/§7bc §8[§eNachricht§8]
|
||||
CHAT_NO_RECEIVER=§cNiemand empfängt deine Nachricht
|
||||
CHAT_EMPTY=§cSchreibe keine inhaltslosen Nachrichten.
|
||||
|
||||
CHAT_SERVERTEAM=§8STC §e{0}§8» §f{2}
|
||||
CHAT_GLOBAL={3}{4}{5}{6}{0}§8» {7}{2}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren