mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-15 07:05:52 +01:00
Add config option to disable message social spy (#3910)
Adds a config option to allow to prevent socialspy from reading private messages. Useful if all you want from social spy is to read commands defined in the list. Closes #1095.
This commit is contained in:
parent
cb168b0c8a
commit
500edb7860
@ -59,6 +59,8 @@ public interface ISettings extends IConf {
|
||||
|
||||
boolean getSocialSpyListenMutedPlayers();
|
||||
|
||||
boolean isSocialSpyMessages();
|
||||
|
||||
Set<String> getMuteCommands();
|
||||
|
||||
/**
|
||||
|
@ -379,6 +379,11 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
return config.getBoolean("socialspy-listen-muted-players", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSocialSpyMessages() {
|
||||
return config.getBoolean("socialspy-messages", true);
|
||||
}
|
||||
|
||||
private Set<String> _getMuteCommands() {
|
||||
final Set<String> muteCommands = new HashSet<>();
|
||||
if (config.isList("mute-commands")) {
|
||||
|
@ -97,6 +97,7 @@ public class SimpleMessageRecipient implements IMessageRecipient {
|
||||
sendMessage(tl("msgFormat", tl("meSender"), recipient.getDisplayName(), message));
|
||||
|
||||
// Better Social Spy
|
||||
if (ess.getSettings().isSocialSpyMessages()) {
|
||||
final User senderUser = getUser(this);
|
||||
final User recipientUser = getUser(recipient);
|
||||
if (senderUser != null // not null if player.
|
||||
@ -116,6 +117,7 @@ public class SimpleMessageRecipient implements IMessageRecipient {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// If the message was a success, set this sender's reply-recipient to the current recipient.
|
||||
|
@ -201,6 +201,10 @@ socialspy-commands:
|
||||
# If so, they will be differentiated from those sent by normal players.
|
||||
socialspy-listen-muted-players: true
|
||||
|
||||
# Whether social spy should spy on private messages or just the commands from the list above.
|
||||
# If false, social spy will only monitor commands from the list above.
|
||||
socialspy-messages: true
|
||||
|
||||
# The following settings listen for when a player changes worlds.
|
||||
# If you use another plugin to control speed and flight, you should change these to false.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user