var username = ns.getString("username");
- final var useDbus = ns.getBoolean("dbus");
- final var useDbusSystem = ns.getBoolean("dbus-system");
+ final var useDbus = Boolean.TRUE.equals(ns.getBoolean("dbus"));
+ final var useDbusSystem = Boolean.TRUE.equals(ns.getBoolean("dbus-system"));
if (useDbus || useDbusSystem) {
// If username is null, it will connect to the default object path
initDbusClient(command, username, useDbusSystem, outputWriter);
return false;
}
- return ns.getBoolean("verbose");
+ return Boolean.TRUE.equals(ns.getBoolean("verbose"));
}
private static void configureLogging(final boolean verbose) {
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;
public void handleCommand(
final Namespace ns, final List<Manager> 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;
public void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
- final boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
+ final boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
final var objectMapper = Util.createJsonObjectMapper();
final var jsonRpcSender = new JsonRpcSender((JsonWriter) outputWriter);
return super.getList(dest + "s");
}
-
- @Override
- public Boolean getBoolean(String dest) {
- Boolean maybeGotten = this.get(dest);
- if (maybeGotten == null) {
- maybeGotten = false;
- }
- return maybeGotten;
- }
}
}
jsonWriter.write(jsonGroups);
} else {
final var writer = (PlainTextWriter) outputWriter;
- boolean detailed = ns.getBoolean("detailed");
+ boolean detailed = Boolean.TRUE.equals(ns.getBoolean("detailed"));
for (var group : groups) {
printGroupPlainText(writer, group, detailed);
}
} catch (NotAGroupMemberException e) {
logger.info("User is not a group member");
}
- if (ns.getBoolean("delete")) {
+ if (Boolean.TRUE.equals(ns.getBoolean("delete"))) {
logger.debug("Deleting group {}", groupId);
m.deleteGroup(groupId);
}
returnOnTimeout = false;
timeout = 3600;
}
- boolean ignoreAttachments = ns.getBoolean("ignore-attachments");
+ boolean ignoreAttachments = Boolean.TRUE.equals(ns.getBoolean("ignore-attachments"));
try {
final var handler = outputWriter instanceof JsonWriter ? new JsonReceiveMessageHandler(m,
(JsonWriter) outputWriter) : new ReceiveMessageHandler(m, (PlainTextWriter) outputWriter);
@Override
public void handleCommand(final Namespace ns, final RegistrationManager m) throws CommandException {
- final boolean voiceVerification = ns.getBoolean("voice");
+ final boolean voiceVerification = Boolean.TRUE.equals(ns.getBoolean("voice"));
final var captchaString = ns.getString("captcha");
final var captcha = captchaString == null ? null : captchaString.replace("signalcaptcha://", "");
public void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
- final var isNoteToSelf = ns.getBoolean("note-to-self");
+ final var isNoteToSelf = Boolean.TRUE.equals(ns.getBoolean("note-to-self"));
final var recipientStrings = ns.<String>getList("recipient");
final var groupIdStrings = ns.<String>getList("group-id");
public void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
- final var isNoteToSelf = ns.getBoolean("note-to-self");
+ final var isNoteToSelf = Boolean.TRUE.equals(ns.getBoolean("note-to-self"));
final var recipientStrings = ns.<String>getList("recipient");
final var groupIdStrings = ns.<String>getList("group-id");
recipientStrings,
groupIdStrings);
- final var isEndSession = ns.getBoolean("end-session");
+ final var isEndSession = Boolean.TRUE.equals(ns.getBoolean("end-session"));
if (isEndSession) {
final var singleRecipients = recipientIdentifiers.stream()
.filter(r -> r instanceof RecipientIdentifier.Single)
public void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
- final var isNoteToSelf = ns.getBoolean("note-to-self");
+ final var isNoteToSelf = Boolean.TRUE.equals(ns.getBoolean("note-to-self"));
final var recipientStrings = ns.<String>getList("recipient");
final var groupIdStrings = ns.<String>getList("group-id");
groupIdStrings);
final var emoji = ns.getString("emoji");
- final var isRemove = ns.getBoolean("remove");
+ final var isRemove = Boolean.TRUE.equals(ns.getBoolean("remove"));
final var targetAuthor = ns.getString("target-author");
final var targetTimestamp = ns.getLong("target-timestamp");
) throws CommandException {
final var recipientStrings = ns.<String>getList("recipient");
final var groupIdStrings = ns.<String>getList("group-id");
- final var action = ns.getBoolean("stop") ? TypingAction.STOP : TypingAction.START;
+ final var action = Boolean.TRUE.equals(ns.getBoolean("stop")) ? TypingAction.STOP : TypingAction.START;
final var recipientIdentifiers = new HashSet<RecipientIdentifier>();
if (recipientStrings != null) {
) throws CommandException {
var recipentString = ns.getString("recipient");
var recipient = CommandUtil.getSingleRecipientIdentifier(recipentString, m.getSelfNumber());
- if (ns.getBoolean("trust-all-known-keys")) {
+ if (Boolean.TRUE.equals(ns.getBoolean("trust-all-known-keys"))) {
boolean res = m.trustIdentityAllKeys(recipient);
if (!res) {
throw new UserErrorException("Failed to set the trust for this number, make sure the number is correct.");
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
try {
- if (ns.getBoolean("delete-account")) {
+ if (Boolean.TRUE.equals(ns.getBoolean("delete-account"))) {
m.deleteAccount();
} else {
m.unregister();
var groupAdmins = CommandUtil.getSingleRecipientIdentifiers(ns.getList("admin"), localNumber);
var groupRemoveAdmins = CommandUtil.getSingleRecipientIdentifiers(ns.getList("remove-admin"), localNumber);
var groupAvatar = ns.getString("avatar");
- var groupResetLink = ns.getBoolean("reset-link");
+ var groupResetLink = Boolean.TRUE.equals(ns.getBoolean("reset-link"));
var groupLinkState = getGroupLinkState(ns.getString("link"));
var groupExpiration = ns.getInt("expiration");
var groupAddMemberPermission = getGroupPermission(ns.getString("set-permission-add-member"));
var about = ns.getString("about");
var aboutEmoji = ns.getString("about-emoji");
var avatarPath = ns.getString("avatar");
- boolean removeAvatar = ns.getBoolean("remove-avatar");
+ boolean removeAvatar = Boolean.TRUE.equals(ns.getBoolean("remove-avatar"));
Optional<File> avatarFile = removeAvatar
? Optional.absent()