mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Implement jsonRpc command
Co-authored-by: technillogue <technillogue@gmail.com> Closes #668
This commit is contained in:
parent
6c00054407
commit
a8bbdb54d0
20 changed files with 863 additions and 31 deletions
|
@ -123,14 +123,17 @@ public class DaemonCommand implements MultiLocalCommand {
|
|||
logger.info("Exported dbus object: " + objectPath);
|
||||
|
||||
final var thread = new Thread(() -> {
|
||||
while (true) {
|
||||
while (!Thread.interrupted()) {
|
||||
try {
|
||||
final var receiveMessageHandler = outputWriter instanceof JsonWriter
|
||||
? new JsonDbusReceiveMessageHandler(m, (JsonWriter) outputWriter, conn, objectPath)
|
||||
: new DbusReceiveMessageHandler(m, (PlainTextWriter) outputWriter, conn, objectPath);
|
||||
m.receiveMessages(1, TimeUnit.HOURS, false, ignoreAttachments, receiveMessageHandler);
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
logger.warn("Receiving messages failed, retrying", e);
|
||||
} catch (InterruptedException ignored) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue