avatarStore,
this::resolveSignalServiceAddress,
account.getRecipientStore());
- this.storageHelper = new StorageHelper(account, dependencies, groupHelper);
+ this.storageHelper = new StorageHelper(account, dependencies, groupHelper, profileHelper);
this.contactHelper = new ContactHelper(account);
this.syncHelper = new SyncHelper(account,
attachmentHelper,
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();
+ }
+
+ final var configurationStore = account.getConfigurationStore();
+ if (readReceipts != null) {
+ configurationStore.setReadReceipts(readReceipts);
+ }
+ if (unidentifiedDeliveryIndicators != null) {
+ configurationStore.setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators);
+ }
+ if (typingIndicators != null) {
+ configurationStore.setTypingIndicators(typingIndicators);
+ }
+ if (linkPreviews != null) {
+ configurationStore.setLinkPreviews(linkPreviews);
+ }
+ syncHelper.sendConfigurationMessage();
+ }
+
+ @Override
+ public List<Boolean> getConfiguration() throws IOException, NotMasterDeviceException {
+ if (!account.isMasterDevice()) {
+ throw new NotMasterDeviceException();
+ }
+ final var configurationStore = account.getConfigurationStore();
+ final Boolean readReceipts = configurationStore.getReadReceipts();
+ final Boolean unidentifiedDeliveryIndicators = configurationStore.getUnidentifiedDeliveryIndicators();
+ final Boolean typingIndicators = configurationStore.getTypingIndicators();
+ final Boolean linkPreviews = configurationStore.getLinkPreviews();
+ return List.of(readReceipts, unidentifiedDeliveryIndicators, typingIndicators, linkPreviews);
+ }
+
/**
* @param givenName if null, the previous givenName will be kept
* @param familyName if null, the previous familyName will be kept
}
@Override
- public void removeLinkedDevices(int deviceId) throws IOException {
+ public void removeLinkedDevices(long deviceId) throws IOException {
dependencies.getAccountManager().removeDevice(deviceId);
var devices = dependencies.getAccountManager().getDevices();
account.setMultiDevice(devices.size() > 1);