}
} else {
// add the presence packet listener to the connection so we only get packets that concerns us
// we must add the listener before creating the muc
final ToContainsFilter toFilter = new ToContainsFilter(endpoint.getParticipant());
final AndFilter packetFilter = new AndFilter(new PacketTypeFilter(Presence.class), toFilter);
connection.addPacketListener(this, packetFilter);
muc = new MultiUserChat(connection, endpoint.resolveRoom(connection));
muc.addMessageListener(this);
DiscussionHistory history = new DiscussionHistory();