mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 16:49:11 +00:00
Remove message filtering
This commit is contained in:
@@ -10,31 +10,21 @@ import org.apollo.net.message.Message;
|
||||
public final class ServerChatMessage extends Message {
|
||||
|
||||
/**
|
||||
* The chat message.
|
||||
* The message to send.
|
||||
*/
|
||||
private final String message;
|
||||
|
||||
/**
|
||||
* Creates a server chat message.
|
||||
* Creates the ServerChatMessage.
|
||||
*
|
||||
* @param message The chat message.
|
||||
* @param message The chat message to send.
|
||||
*/
|
||||
public ServerChatMessage(String message) {
|
||||
this(message, false);
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a server chat message.
|
||||
*
|
||||
* @param message The chat message.
|
||||
* @param filterable Whether or not the message can be filtered.
|
||||
*/
|
||||
public ServerChatMessage(String message, boolean filterable) {
|
||||
this.message = message + (filterable ? ":filterable:" : "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the chat message.
|
||||
* Gets the chat message to send.
|
||||
*
|
||||
* @return The chat message.
|
||||
*/
|
||||
|
||||
@@ -143,11 +143,6 @@ public final class Player extends Mob {
|
||||
*/
|
||||
private boolean excessivePlayers;
|
||||
|
||||
/**
|
||||
* Indicates whether this player has the message filter enabled.
|
||||
*/
|
||||
private boolean filteringMessages;
|
||||
|
||||
/**
|
||||
* The privacy state of this player's private chat.
|
||||
*/
|
||||
@@ -652,15 +647,6 @@ public final class Player extends Mob {
|
||||
localObjects.forEach(object -> object.removeFrom(this));
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the message filter is enabled.
|
||||
*
|
||||
* @return {@code true} if the filter is enabled, otherwise {@code false}.
|
||||
*/
|
||||
public boolean messageFilterEnabled() {
|
||||
return filteringMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens this player's bank.
|
||||
*/
|
||||
@@ -768,24 +754,12 @@ public final class Player extends Mob {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to the player.
|
||||
* Sends the specified chat message to the player.
|
||||
*
|
||||
* @param message The message.
|
||||
* @param message The message to send.
|
||||
*/
|
||||
public void sendMessage(String message) {
|
||||
sendMessage(message, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a message to the player.
|
||||
*
|
||||
* @param message The message.
|
||||
* @param filterable Whether or not the message can be filtered.
|
||||
*/
|
||||
public void sendMessage(String message, boolean filterable) {
|
||||
if (!filterable || !filteringMessages) {
|
||||
send(new ServerChatMessage(message));
|
||||
}
|
||||
send(new ServerChatMessage(message));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -984,15 +958,6 @@ public final class Player extends Mob {
|
||||
.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the message filter.
|
||||
*
|
||||
* @return The new value of the filter.
|
||||
*/
|
||||
public boolean toggleMessageFilter() {
|
||||
return filteringMessages = !filteringMessages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the player's run status.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user