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()) { if (!account.isMasterDevice()) {
throw new NotMasterDeviceException(); throw new NotMasterDeviceException();
} }
final var configurationStore = account.getConfigurationStore();
if (readReceipts != null) { if (readReceipts != null) {
account.getConfigurationStore().setReadReceipts(readReceipts); configurationStore.setReadReceipts(readReceipts);
} }
if (unidentifiedDeliveryIndicators != null) { if (unidentifiedDeliveryIndicators != null) {
account.getConfigurationStore().setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators); configurationStore.setUnidentifiedDeliveryIndicators(unidentifiedDeliveryIndicators);
} }
if (typingIndicators != null) { if (typingIndicators != null) {
account.getConfigurationStore().setTypingIndicators(typingIndicators); configurationStore.setTypingIndicators(typingIndicators);
} }
if (linkPreviews != null) { if (linkPreviews != null) {
account.getConfigurationStore().setLinkPreviews(linkPreviews); configurationStore.setLinkPreviews(linkPreviews);
} }
syncHelper.sendConfigurationMessage(); syncHelper.sendConfigurationMessage();
} }

View file

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