private void registerListener()
{
PacketFilter normalTypeFilter = new MessageTypeFilter(Message.Type.normal);
PacketFilter chatTypeFilter = new MessageTypeFilter(Message.Type.chat);
PacketFilter mucTypeFilter = new MessageTypeFilter(Message.Type.groupchat);
PacketFilter filter = new OrFilter(normalTypeFilter, chatTypeFilter);
filter = new OrFilter(filter, mucTypeFilter);
if (synchronous)
{
packetCollector = connection.createPacketCollector(filter);
}