- final var readReceipts = ns.getBoolean("read-receipts");
- final var unidentifiedDeliveryIndicators = ns.getBoolean("unidentified-delivery-indicators");
- final var typingIndicators = ns.getBoolean("typing-indicators");
- final var linkPreviews = ns.getBoolean("link-previews");
+ var readReceipts = ns.getBoolean("read-receipts");
+ var unidentifiedDeliveryIndicators = ns.getBoolean("unidentified-delivery-indicators");
+ var typingIndicators = ns.getBoolean("typing-indicators");
+ var linkPreviews = ns.getBoolean("link-previews");
+ List<Boolean> configuration = new ArrayList<>(4);
+
+ try {
+ configuration = m.getConfiguration();
+ } catch (IOException | NotMasterDeviceException e) {
+ throw new CommandException(e.getMessage());
+ }
+
+ if (readReceipts == null) {
+ try {
+ readReceipts = configuration.get(0);
+ } catch (NullPointerException e) {
+ readReceipts = true;
+ }
+ }
+ if (unidentifiedDeliveryIndicators == null) {
+ try {
+ unidentifiedDeliveryIndicators = configuration.get(1);
+ } catch (NullPointerException e) {
+ unidentifiedDeliveryIndicators = true;
+ }
+ }
+ if (typingIndicators == null) {
+ try {
+ typingIndicators = configuration.get(2);
+ } catch (NullPointerException e) {
+ typingIndicators = true;
+ }
+ }
+ if (linkPreviews == null) {
+ try {
+ linkPreviews = configuration.get(3);
+ } catch (NullPointerException e) {
+ linkPreviews = true;
+ }
+ }