X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/6dd1a216062baa6503d158dcaac5ee1a2cd1b43e..c9f5550d1821ee99879c75db124baf46642fd846:/src/main/java/org/asamk/signal/commands/DaemonCommand.java diff --git a/src/main/java/org/asamk/signal/commands/DaemonCommand.java b/src/main/java/org/asamk/signal/commands/DaemonCommand.java index 0591486c..5045db9a 100644 --- a/src/main/java/org/asamk/signal/commands/DaemonCommand.java +++ b/src/main/java/org/asamk/signal/commands/DaemonCommand.java @@ -54,10 +54,10 @@ public class DaemonCommand implements MultiLocalCommand { public void handleCommand( final Namespace ns, final Manager m, final OutputWriter outputWriter ) throws CommandException { - boolean ignoreAttachments = ns.getBoolean("ignore-attachments"); + boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments")); DBusConnection.DBusBusType busType; - if (ns.getBoolean("system")) { + if (Boolean.TRUE.equals(ns.getBoolean("system"))) { busType = DBusConnection.DBusBusType.SYSTEM; } else { busType = DBusConnection.DBusBusType.SESSION; @@ -75,7 +75,7 @@ public class DaemonCommand implements MultiLocalCommand { } } catch (DBusException | IOException e) { logger.error("Dbus command failed", e); - throw new UnexpectedErrorException("Dbus command failed"); + throw new UnexpectedErrorException("Dbus command failed", e); } } @@ -83,10 +83,10 @@ public class DaemonCommand implements MultiLocalCommand { public void handleCommand( final Namespace ns, final List managers, final SignalCreator c, final OutputWriter outputWriter ) throws CommandException { - boolean ignoreAttachments = ns.getBoolean("ignore-attachments"); + boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments")); DBusConnection.DBusBusType busType; - if (ns.getBoolean("system")) { + if (Boolean.TRUE.equals(ns.getBoolean("system"))) { busType = DBusConnection.DBusBusType.SYSTEM; } else { busType = DBusConnection.DBusBusType.SESSION; @@ -95,7 +95,7 @@ public class DaemonCommand implements MultiLocalCommand { try (var conn = DBusConnection.getConnection(busType)) { final var signalControl = new DbusSignalControlImpl(c, m -> { try { - final var objectPath = DbusConfig.getObjectPath(m.getUsername()); + final var objectPath = DbusConfig.getObjectPath(m.getSelfNumber()); return run(conn, objectPath, m, outputWriter, ignoreAttachments); } catch (DBusException e) { logger.error("Failed to export object", e); @@ -113,7 +113,7 @@ public class DaemonCommand implements MultiLocalCommand { signalControl.run(); } catch (DBusException | IOException e) { logger.error("Dbus command failed", e); - throw new UnexpectedErrorException("Dbus command failed"); + throw new UnexpectedErrorException("Dbus command failed", e); } }