diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java index 4089c74fd..9dc87bc2c 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/irc/IRCFilter.java @@ -24,18 +24,8 @@ abstract class IRCFilter { /** does not override DCC handling */ private static final boolean ALLOW_ALL_CTCP_OUT = false; - /************************************************************************* - * - * Modify or filter a single inbound line. - * - * @param helper may be null - * @return the original or modified line, or null if it should be dropped. - */ - public static String inboundFilter(String s, StringBuffer expectedPong, DCCHelper helper) { - - String field[] = DataHelper.split(s, " ", 4); - String command; - int idx=0; + private static final Set _allowedInbound; + static { final String[] allowedCommands = { // "NOTICE", // can contain CTCP @@ -57,6 +47,21 @@ abstract class IRCFilter { "PROTOCTL", "AWAY" }; + _allowedInbound = new HashSet(Arrays.asList(allowedCommands)); + } + + /************************************************************************* + * + * Modify or filter a single inbound line. + * + * @param helper may be null + * @return the original or modified line, or null if it should be dropped. + */ + public static String inboundFilter(String s, StringBuffer expectedPong, DCCHelper helper) { + + String field[] = DataHelper.split(s, " ", 4); + String command; + int idx=0; try { @@ -94,8 +99,7 @@ abstract class IRCFilter { } // Allow all allowedCommands - for(int i=0;i