public static Room createRoom(String name, MultiUserChat chat, XMPPConnection con) { final Room r = new Room(name, chat); try { r.info = MultiUserChat.getRoomInfo(con, (name.indexOf("@") != -1 ? name : name + "@" + CONF_URL)); } catch (XMPPException e) { e.printStackTrace(); } r.subject = r.info.getSubject(); chat.addSubjectUpdatedListener(new SubjectUpdatedListener() { public void subjectUpdated(String newsubject, String from) { r.subject = newsubject; } }); for (String user : r.getConnectedUsers()) { r.users.add(user); } r.startThread(); return r; }