]> nmode's Git Repositories - signal-cli/blobdiff - lib/src/main/java/org/asamk/signal/manager/ManagerImpl.java
Implement configuration handling
[signal-cli] / lib / src / main / java / org / asamk / signal / manager / ManagerImpl.java
index de60fa50aa8ce8b90d00f7727ef00e95c7fad763..36c131db1996941cc80724e2e0eae0a33653b55d 100644 (file)
@@ -320,6 +320,31 @@ public class ManagerImpl implements Manager {
                         account.isDiscoverableByPhoneNumber());
     }
 
+    @Override
+    public void updateConfiguration(
+            final Boolean readReceipts,
+            final Boolean unidentifiedDeliveryIndicators,
+            final Boolean typingIndicators,
+            final Boolean linkPreviews
+    ) throws IOException, NotMasterDeviceException {
+        if (!account.isMasterDevice()) {
+            throw new NotMasterDeviceException();
+        }
+        if (readReceipts != null) {
+            account.getConfigurationStore().setReadReceipts(readReceipts);
+        }
+        if (unidentifiedDeliveryIndicators != null) {
+            account.getConfigurationStore().setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators);
+        }
+        if (typingIndicators != null) {
+            account.getConfigurationStore().setTypingIndicators(typingIndicators);
+        }
+        if (linkPreviews != null) {
+            account.getConfigurationStore().setLinkPreviews(linkPreviews);
+        }
+        syncHelper.sendConfigurationMessage();
+    }
+
     /**
      * @param givenName  if null, the previous givenName will be kept
      * @param familyName if null, the previous familyName will be kept