Message message = (Message) messageCollector.nextResult(
SmackConfiguration.getPacketReplyTimeout());
while (message != null) {
messages.add(message);
message =
(Message) messageCollector.nextResult(
SmackConfiguration.getPacketReplyTimeout());
}
// Stop queuing offline messages
messageCollector.cancel();
return messages.iterator();