[Feature] Added an option to spy chat messages from muted players (#1430)

Related to https://github.com/drtshock/Essentials/issues/1420
This commit is contained in:
Florian CUNY 2017-08-04 01:04:42 +02:00 committed by Ali 'SupaHam' M
parent 7fbc721db6
commit fd63a7df4e
6 changed files with 36 additions and 14 deletions

View file

@ -95,8 +95,12 @@ public class SimpleMessageRecipient implements IMessageRecipient {
if (onlineUser.isSocialSpyEnabled()
// Don't send socialspy messages to message sender/receiver to prevent spam
&& !onlineUser.equals(senderUser)
&& !onlineUser.equals(recipient)) {
onlineUser.sendMessage(tl("socialSpyPrefix") + tl("msgFormat", getDisplayName(), recipient.getDisplayName(), message));
&& !onlineUser.equals(recipient)) {
if (senderUser.isMuted() && ess.getSettings().getSocialSpyListenMutedPlayers()) {
onlineUser.sendMessage(tl("socialMutedSpyPrefix") + tl("msgFormat", getDisplayName(), recipient.getDisplayName(), message));
} else {
onlineUser.sendMessage(tl("socialSpyPrefix") + tl("msgFormat", getDisplayName(), recipient.getDisplayName(), message));
}
}
}
}