public void textInput(String channel,String text){
  if (text.isEmpty()) {
    return;
  }
  if (text.startsWith("/")) {
    commandInput(channel,text);
  }
 else {
    if (c.onChannel(channel)) {
      sendMessage(channel,text);
    }
 else     if (channel.startsWith("$")) {
      w.whisperChannel(channel,text);
    }
 else     if (channel.startsWith("*")) {
      c.sendCommandMessage(channel,text,"> " + text);
    }
 else {
      g.printLine("Not in a channel");
      if (Chatty.DEBUG) {
        g.printMessage(channel,testUser,text,false,null,1);
      }
    }
  }
}

public void textInput ( String channel , String text ) { if ( text . isEmpty ( ) ) { return ; } if ( text . startsWith ( "/" ) ) { commandInput ( channel , text ) ; } else { if ( c . onChannel ( channel ) ) { sendMessage ( channel , text ) ; } else if ( channel . startsWith ( "$" ) ) { w . whisperChannel ( channel , text ) ; } else if ( channel . startsWith ( "*" ) ) { c . sendCommandMessage ( channel , text , "> " + text ) ; } else { g . printLine ( "Not in a channel" ) ; if ( Chatty . DEBUG ) { g . printMessage ( channel , testUser , text , false , null , 1 ) ; } } } }
anything entered in a channel input box is reacted to here . this must be safe input ( i . e . input directly by the local user ) because this can execute all kind of commands .
