Skip to content

Commit

Permalink
Merge pull request #7 from jacobmarshall/feature/3-bypass
Browse files Browse the repository at this point in the history
Add bypass filter permission [Closes #3]
  • Loading branch information
jmshal committed Jan 31, 2016
2 parents 430667e + 89117ab commit 4c1d043
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public void onPlayerChat (AsyncPlayerChatEvent event) {
if (config.isEnabled()) {
Player player = event.getPlayer();
String message = event.getMessage();
boolean shouldFilter = ! player.hasPermission("meloooncensor.bypass"); // Users with this permission don't need to go through the filter

if (config.getFilter().violatesPolicy(message)) {
if (shouldFilter && config.getFilter().violatesPolicy(message)) {
String censoredMessage = config.getFilter().censorMessage(message);

if (censoredMessage == null) {
Expand Down

0 comments on commit 4c1d043

Please sign in to comment.