Java 类org.jivesoftware.smackx.muc.SubjectUpdatedListener 实例源码

项目:HippyJava    文件:Room.java   
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;
}