From 226a75472cc394a2da1656e1a8874379dc028c2d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Thu, 20 Dec 2012 23:37:37 +0000 Subject: Adjust section matching. --- .../src/com/earth2me/essentials/Settings.java | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index 2ad5a444c..d3c6b49d5 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -237,29 +237,31 @@ public class Settings implements ISettings } return 0.0; } - private Set socialSpyCommands = new HashSet(); - + public Set _getSocialSpyCommands() { Set socialspyCommands = new HashSet(); - - if (!config.hasProperty("socialspy-commands")) { - socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "whisper", "emsg", "t", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm")); + + if (config.isConfigurationSection("socialspy-commands")) + { + for (String c : config.getStringList("socialspy-commands")) + { + socialspyCommands.add(c.toLowerCase(Locale.ENGLISH)); + } } - - for (String c : config.getStringList("socialspy-commands")) + else { - socialspyCommands.add(c.toLowerCase(Locale.ENGLISH)); + socialspyCommands.addAll(Arrays.asList("msg", "r", "mail", "m", "whisper", "emsg", "t", "tell", "er", "reply", "ereply", "email", "action", "describe", "eme", "eaction", "edescribe", "etell", "ewhisper", "pm")); } return socialspyCommands; } - - public Set getSocialSpyCommands() { + + public Set getSocialSpyCommands() + { return socialSpyCommands; } - private String nicknamePrefix = "~"; private String _getNicknamePrefix() -- cgit v1.2.3