1 package zirc.msg ; 2 3 import zirc.base.* ; 4 import zirc.gui.* ; 5 import zirc.threads.* ; 6 7 20 27 28 29 public class MSGkick extends AbstractMessage 30 { 31 private String tokens[] = new String [5] ; 32 private IRCconnexion IRCchan ; 33 34 public MSGkick(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[3].substring(0, tokens[3].length()).equals(IRCchan.GetUser_nickName())) 49 { 50 ChatFrame frm = IRCchan.GetFenetreDuChan(tokens[2]) ; 51 frm.destroyForKick() ; 52 } 53 54 else 55 { 56 if ((tokens[2].startsWith("#"))) 57 { 58 ChatFrame cht = _IRCchan.GetFenetreDuChan(tokens[2]) ; 59 if (cht != null) 60 { 61 this.frm = cht ; 62 } 63 } 64 } 65 66 } 67 68 protected void setColor(StringBuffer _htmlMsg) 69 { 70 _htmlMsg.insert(0, "<font color=" + vectColors[4] + ">") ; 71 _htmlMsg.append("</font>") ; 72 } 73 74 public String parseMessagePourAffichage(String _txtAffiche) 76 { 77 83 String initiateur ; 84 int ind = tokens[0].indexOf("!") ; 85 86 if (ind > -1) 87 { 88 initiateur = tokens[0].substring(1, ind) ; 90 } 91 else 92 { 93 initiateur = tokens[0].substring(1) ; 94 } 95 96 if (tokens[3].substring(0, tokens[3].length()).equals(IRCchan.GetUser_nickName())) 98 { 99 return "* " + initiateur + " vous a kicke " + tokens[4] ; 100 } 101 else 102 { 103 IRCchan.ajouteTache(new KickUserThread(IRCchan, tokens[2], tokens[3])) ; 104 return "* " + initiateur + " a kicke " + tokens[3] + " " + tokens[4] ; 105 } 106 } 107 108 protected boolean informeUser() 109 { 110 return false ; 111 } 112 113 } 114 | Popular Tags |