public void writeRoom(String number,String contact,XmppMsg message,int mode) throws Exception {
  MultiUserChat muc;
  muc=inviteRoom(number,contact,mode);
  if (muc != null) {
    try {
      Message msg=new Message(muc.getRoom());
      msg.setBody(message.generateFmtTxt());
      if (mode == MODE_SHELL) {
        XHTMLManager.addBody(msg,message.generateXHTMLText());
      }
      msg.setType(Message.Type.groupchat);
      muc.sendMessage(msg);
    }
 catch (    Exception e) {
      muc.sendMessage(message.generateTxt());
    }
  }
}

public void writeRoom ( String number , String contact , XmppMsg message , int mode ) throws Exception { MultiUserChat muc ; muc = inviteRoom ( number , contact , mode ) ; if ( muc != null ) { try { Message msg = new Message ( muc . getRoom ( ) ) ; msg . setBody ( message . generateFmtTxt ( ) ) ; if ( mode == MODE_SHELL ) { XHTMLManager . addBody ( msg , message . generateXHTMLText ( ) ) ; } msg . setType ( Message . Type . groupchat ) ; muc . sendMessage ( msg ) ; } catch ( Exception e ) { muc . sendMessage ( message . generateTxt ( ) ) ; } } }
writes a formatted message to a room and creates the room if necessary , followed by an invite to the default notification address to join the room
