mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Reduce default receive timeout to 1 second
This commit is contained in:
parent
6eb486e858
commit
56ac648922
1 changed files with 2 additions and 4 deletions
|
@ -35,6 +35,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
||||||
public void attachToSubparser(final Subparser subparser) {
|
public void attachToSubparser(final Subparser subparser) {
|
||||||
subparser.addArgument("-t", "--timeout")
|
subparser.addArgument("-t", "--timeout")
|
||||||
.type(double.class)
|
.type(double.class)
|
||||||
|
.setDefault(1.0)
|
||||||
.help("Number of seconds to wait for new messages (negative values disable timeout)");
|
.help("Number of seconds to wait for new messages (negative values disable timeout)");
|
||||||
subparser.addArgument("--ignore-attachments")
|
subparser.addArgument("--ignore-attachments")
|
||||||
.help("Don’t download attachments of received messages.")
|
.help("Don’t download attachments of received messages.")
|
||||||
|
@ -148,10 +149,7 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
||||||
logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
|
logger.warn("\"--json\" option has been deprecated, please use the global \"--output=json\" instead.");
|
||||||
}
|
}
|
||||||
|
|
||||||
double timeout = 5;
|
double timeout = ns.getDouble("timeout");
|
||||||
if (ns.getDouble("timeout") != null) {
|
|
||||||
timeout = ns.getDouble("timeout");
|
|
||||||
}
|
|
||||||
var returnOnTimeout = true;
|
var returnOnTimeout = true;
|
||||||
if (timeout < 0) {
|
if (timeout < 0) {
|
||||||
returnOnTimeout = false;
|
returnOnTimeout = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue