Make log notifications toggleable

This commit is contained in:
Luck 2016-08-30 16:02:01 +01:00
parent b37fdd3619
commit 9b4bbe0500
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
5 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,9 @@ apply-regex: true
# If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand: true
# If the plugin should send log notifications to users whenever permissions are modified.
log-notify: true
# Which storage method the plugin should use.
# Currently supported: mysql, sqlite, h2, flatfile, mongodb
# Fill out connection info below if you're using MySQL or MongoDB

View File

@ -39,6 +39,9 @@ apply-regex: true
# If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand: true
# If the plugin should send log notifications to users whenever permissions are modified.
log-notify: true
# Which storage method the plugin should use.
# Currently supported: mysql, sqlite, h2, flatfile, mongodb
# Fill out connection info below if you're using MySQL or MongoDB

View File

@ -102,6 +102,10 @@ public abstract class LPConfiguration<T extends LuckPermsPlugin> {
return getBoolean("apply-shorthand", true);
}
public boolean getLogNotify() {
return getBoolean("log-notify", true);
}
public DatastoreConfiguration getDatabaseValues() {
return new DatastoreConfiguration(
getString("data.address", null),

View File

@ -52,6 +52,7 @@ public class LogEntry extends me.lucko.luckperms.api.LogEntry {
plugin.getDatastore().logAction(this);
LogNotifyEvent event = new LogNotifyEvent(this);
event.setCancelled(plugin.getConfiguration().getLogNotify());
plugin.getApiProvider().fireEvent(event);
if (event.isCancelled()) return;

View File

@ -39,6 +39,9 @@ apply-regex=true
# If set to true, LuckPerms will detect and expand shorthand node patterns.
apply-shorthand=true
# If the plugin should send log notifications to users whenever permissions are modified.
log-notify=true
# Which storage method the plugin should use.
# Currently supported: mysql, sqlite, h2, flatfile, mongodb
# Fill out connection info below if you're using MySQL or MongoDB