我正在使用以下代码重新连接到现有聊天室..
try {
mucChat = new MultiUserChat(connection,groupname+"@conference.serviceName");
DiscussionHistory history = new DiscussionHistory();
history.setMaxStanzas(30);
mucChat.join("username", "password", history, SmackConfiguration.getPacketReplyTimeout());
} catch (XMPPException e) {
e.printStackTrace();
}
但我无法获得历史记录......我正在ClassCastException
获得
@Override
public void processPacket(final Packet packet) {
final Message message = (Message) packet;
}
抛出异常:
java.lang.ClassCastException: org.jivesoftware.smack.packet.Presence cannot be cast to org.jivesoftware.smack.packet.Message