1 package zirc.msg ; 2 3 import zirc.base.* ; 4 import zirc.gui.* ; 5 6 19 26 27 28 public class MSGprivMsg extends AbstractMessage 29 { 30 private String user ; 31 private String destination ; 32 33 public MSGprivMsg(IRCconnexion _IRCchan, Object _user, Object _chan, String _total) 34 { 35 super(_IRCchan, _total) ; 36 37 destination = (String )(_chan) ; 38 39 user = (String )(_user) ; 41 int ind = user.indexOf("!") ; 42 if (ind > 0) 43 { 44 user = user.substring(1, ind) ; 45 } 46 47 } 48 49 public void reagit() 50 { 51 if (destination.startsWith("#")) 55 { 56 ChatFrame cht = ircChan.GetFenetreDuChan(destination) ; 57 if (cht != null) 58 { 59 this.frm = cht ; 60 } 61 } 62 else 63 { 64 String correspondant ; 66 67 if (ircChan.GetUser_nickName().equalsIgnoreCase(destination)) 69 { 70 correspondant = user ; 71 } 72 else 73 { 74 correspondant = destination ; 75 } 76 77 PrivateFrame prm = ircChan.GetFenetreDuPrive(correspondant) ; 78 if (prm == null) 79 { 80 prm = ircChan.createPrivateFrame(correspondant) ; 81 } 82 83 frm = prm ; 85 } 86 87 } 88 89 public String parseMessagePourAffichage(String _txtAffiche) 91 { 92 String ret = "" ; 93 int ind ; 94 95 ret = "<" + user + "> " ; 97 98 ind = _txtAffiche.indexOf(":", 2) ; 100 if (ind > 0) 101 { 102 ret += _txtAffiche.substring(ind + 1) ; 103 } 104 105 return ret ; 106 } 107 } 108 | Popular Tags |