Extract configurationStore variable

This commit is contained in:
AsamK 2021-10-01 17:52:33 +02:00
parent 6f5e72119e
commit 9839be48f3
2 changed files with 12 additions and 10 deletions

View file

@ -330,17 +330,19 @@ public class ManagerImpl implements Manager {
if (!account.isMasterDevice()) {
throw new NotMasterDeviceException();
}
final var configurationStore = account.getConfigurationStore();
if (readReceipts != null) {
account.getConfigurationStore().setReadReceipts(readReceipts);
configurationStore.setReadReceipts(readReceipts);
}
if (unidentifiedDeliveryIndicators != null) {
account.getConfigurationStore().setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators);
configurationStore.setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators);
}
if (typingIndicators != null) {
account.getConfigurationStore().setTypingIndicators(typingIndicators);
configurationStore.setTypingIndicators(typingIndicators);
}
if (linkPreviews != null) {
account.getConfigurationStore().setLinkPreviews(linkPreviews);
configurationStore.setLinkPreviews(linkPreviews);
}
syncHelper.sendConfigurationMessage();
}

View file

@ -357,11 +357,11 @@ public final class IncomingMessageHandler {
}
if (syncMessage.getConfiguration().isPresent()) {
final var configurationMessage = syncMessage.getConfiguration().get();
account.getConfigurationStore().setReadReceipts(configurationMessage.getReadReceipts().orNull());
account.getConfigurationStore().setLinkPreviews(configurationMessage.getLinkPreviews().orNull());
account.getConfigurationStore().setTypingIndicators(configurationMessage.getTypingIndicators().orNull());
account.getConfigurationStore()
.setUnidentifiedDeliveryIndicators(configurationMessage.getUnidentifiedDeliveryIndicators()
final var configurationStore = account.getConfigurationStore();
configurationStore.setReadReceipts(configurationMessage.getReadReceipts().orNull());
configurationStore.setLinkPreviews(configurationMessage.getLinkPreviews().orNull());
configurationStore.setTypingIndicators(configurationMessage.getTypingIndicators().orNull());
configurationStore.setUnidentifiedDeliveryIndicators(configurationMessage.getUnidentifiedDeliveryIndicators()
.orNull());
}
return actions;