mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Don't wait the reply timeout in OfflineMessageManager.getMessages(List<String>)
for the last message. We now count the number of messages we want to retrieve, and don't wait for another message if we have already received all. Thanks to King Jeong Hun for reporting this.
This commit is contained in:
parent
f31cc6e043
commit
b5415fe841
1 changed files with 3 additions and 1 deletions
|
@ -158,12 +158,14 @@ public class OfflineMessageManager {
|
|||
return nodes.contains(info.getNode());
|
||||
}
|
||||
});
|
||||
int pendingNodes = nodes.size();
|
||||
StanzaCollector messageCollector = connection.createStanzaCollector(messageFilter);
|
||||
try {
|
||||
connection.createStanzaCollectorAndSend(request).nextResultOrThrow();
|
||||
// Collect the received offline messages
|
||||
Message message = messageCollector.nextResult();
|
||||
while (message != null) {
|
||||
while (message != null && pendingNodes > 0) {
|
||||
pendingNodes--;
|
||||
messages.add(message);
|
||||
message = messageCollector.nextResult();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue