import java.util.Set;
import java.util.concurrent.TimeUnit;
-import static org.asamk.signal.util.ErrorUtils.handleAssertionError;
-
public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
private final static Logger logger = LoggerFactory.getLogger(ReceiveCommand.class);
public void attachToSubparser(final Subparser subparser) {
subparser.addArgument("-t", "--timeout")
.type(double.class)
+ .setDefault(3.0)
.help("Number of seconds to wait for new messages (negative values disable timeout)");
subparser.addArgument("--ignore-attachments")
.help("Don’t download attachments of received messages.")
logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
}
- double timeout = 5;
- if (ns.getDouble("timeout") != null) {
- timeout = ns.getDouble("timeout");
- }
+ double timeout = ns.getDouble("timeout");
var returnOnTimeout = true;
if (timeout < 0) {
returnOnTimeout = false;
handler);
} catch (IOException e) {
throw new IOErrorException("Error while receiving messages: " + e.getMessage());
- } catch (AssertionError e) {
- handleAssertionError(e);
- throw e;
}
}
}