1 package rero.client.server; 2 3 import java.util.*; 4 import rero.config.*; 5 import rero.util.*; 6 7 10 public class IgnoreHandler implements ClientStateListener 11 { 12 protected boolean checkIgnore; 13 protected StringList ignoreMasks; 14 15 public void propertyChanged(String prop, String parms) { hash(); } 16 17 public void hash() 18 { 19 ignoreMasks = ClientState.getClientState().getStringList("ignore.masks"); 20 checkIgnore = ignoreMasks.getList().size() > 0; 21 } 22 23 public IgnoreHandler() 24 { 25 hash(); 26 ClientState.getClientState().addClientStateListener("ignore.masks", this); 27 } 28 29 public boolean isCheckingIgnore() 30 { 31 return checkIgnore; 32 } 33 34 public boolean isIgnore(String nick, String host) 35 { 36 String temp = nick + "!" + host; 37 38 Iterator i = ignoreMasks.getList().iterator(); 39 while (i.hasNext()) 40 { 41 String mask = (String )i.next(); 42 if (StringUtils.iswm(mask, temp)) 43 return true; 44 } 45 46 return false; 47 } 48 } 49 50 | Popular Tags |