1 package zirc.msg ; 2 3 import zirc.base.* ; 4 import zirc.gui.* ; 5 import zirc.threads.* ; 6 7 20 27 28 public class MSGmode extends AbstractMessage 29 { 30 31 private String tokens[] = new String [5] ; 32 private IRCconnexion IRCchan ; 33 34 public MSGmode(IRCconnexion _IRCchan, Object _tk1, Object _tk2, Object _tk3, Object _tk4, Object _tk5) 35 { 36 super(_IRCchan, _tk1 + " " + _tk2 + " " + _tk3 + " " + _tk4 + " " + _tk5) ; 37 IRCchan = _IRCchan ; 38 tokens[0] = (String )(_tk1) ; 39 tokens[1] = (String )(_tk2) ; 40 tokens[2] = (String )(_tk3) ; 41 tokens[3] = (String )(_tk4) ; 42 tokens[4] = (String )(_tk5) ; 43 44 if (tokens[2].startsWith("#")) 48 { 49 ChatFrame cht = _IRCchan.GetFenetreDuChan(tokens[2]) ; 50 if (cht != null) 51 { 52 this.frm = cht ; 53 } 54 } 55 } 56 57 protected void setColor(StringBuffer _htmlMsg) 58 { 59 _htmlMsg.insert(0, "<font color=" + vectColors[1] + ">") ; 60 _htmlMsg.append("</font>") ; 61 } 62 63 public String parseMessagePourAffichage(String _txtAffiche) 65 { 66 75 try 76 { 77 tokens[4].length() ; 78 } 79 catch (NullPointerException ex) 80 { 81 tokens[4] = "" ; 82 } 83 finally 84 { 85 String initiateur ; 86 int ind = tokens[0].indexOf("!") ; 87 88 if (ind > -1) 89 { 90 initiateur = tokens[0].substring(1, ind) ; 92 } 93 else 94 { 95 initiateur = tokens[0].substring(1) ; 96 } 97 98 if (tokens[4].length() == 0) 99 { 100 return "* " + initiateur + " met le mode: " + tokens[3] + " " + tokens[2] ; 101 } 102 else 103 { 104 IRCchan.sendCommand("NAMES "+tokens[2]); 105 return "* " + initiateur + " met le mode: " + tokens[3] + " " + tokens[4] ; 106 } 107 } 108 } 109 110 protected boolean informeUser() 111 { 112 return false ; 113 } 114 115 } 116 | Popular Tags |