1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-29 09:42:06 +01:00

Send request after the PacketCollector was setup

This bug was introduced with 7bd7b3d24. Thanks to Lars Noschinski for
discovering it.
This commit is contained in:
Florian Schmaus 2014-02-24 08:30:51 +01:00
parent 3093333533
commit 2c7f1efe80

View file

@ -141,8 +141,6 @@ public class OfflineMessageManager {
item.setAction("view");
request.addItem(item);
}
connection.createPacketCollectorAndSend(request).nextResultOrThrow();
// Filter offline messages that were requested by this request
PacketFilter messageFilter = new AndFilter(packetFilter, new PacketFilter() {
public boolean accept(Packet packet) {
@ -152,6 +150,7 @@ public class OfflineMessageManager {
}
});
PacketCollector messageCollector = connection.createPacketCollector(messageFilter);
connection.createPacketCollectorAndSend(request).nextResultOrThrow();
// Collect the received offline messages
Message message = (Message) messageCollector.nextResult();
while (message != null) {