Presence presence = new Presence(Presence.Type.available);
presence.setTo(roomJID);
//Setting MaxStanzas to 0
MUCInitialPresence m = new MUCInitialPresence();
History h = new History();
h.setMaxStanzas(0);
m.setHistory(h);
presence.addExtension(m);
try {
connection.sendStanza(presence);
} catch (NotConnectedException e) {
}
# 1 楼答案
向群发送可用状态时,可以将MaxStanzas设置为0,以避免收到旧的群消息