mirror of
https://github.com/aljazceru/signal-cli.git
synced 2026-01-31 03:24:21 +01:00
Split receiveMessages method
This commit is contained in:
@@ -193,9 +193,15 @@ public interface Manager extends Closeable {
|
||||
|
||||
void requestAllSyncData() throws IOException;
|
||||
|
||||
void receiveMessages(
|
||||
long timeout, TimeUnit unit, boolean returnOnTimeout, ReceiveMessageHandler handler
|
||||
) throws IOException;
|
||||
/**
|
||||
* Receive new messages from server, returns if no new message arrive in a timespan of timeout.
|
||||
*/
|
||||
void receiveMessages(long timeout, TimeUnit unit, ReceiveMessageHandler handler) throws IOException;
|
||||
|
||||
/**
|
||||
* Receive new messages from server, returns only if the thread is interrupted.
|
||||
*/
|
||||
void receiveMessages(ReceiveMessageHandler handler) throws IOException;
|
||||
|
||||
void setIgnoreAttachments(boolean ignoreAttachments);
|
||||
|
||||
|
||||
@@ -873,7 +873,16 @@ public class ManagerImpl implements Manager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveMessages(
|
||||
public void receiveMessages(long timeout, TimeUnit unit, ReceiveMessageHandler handler) throws IOException {
|
||||
receiveMessages(timeout, unit, true, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveMessages(ReceiveMessageHandler handler) throws IOException {
|
||||
receiveMessages(1L, TimeUnit.HOURS, false, handler);
|
||||
}
|
||||
|
||||
private void receiveMessages(
|
||||
long timeout, TimeUnit unit, boolean returnOnTimeout, ReceiveMessageHandler handler
|
||||
) throws IOException {
|
||||
retryFailedReceivedMessages(handler);
|
||||
|
||||
Reference in New Issue
Block a user