mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Check if configuration message contains value before using it
This commit is contained in:
parent
0e56d1c32a
commit
cf31ad6ccf
1 changed files with 13 additions and 5 deletions
|
@ -358,11 +358,19 @@ public final class IncomingMessageHandler {
|
||||||
if (syncMessage.getConfiguration().isPresent()) {
|
if (syncMessage.getConfiguration().isPresent()) {
|
||||||
final var configurationMessage = syncMessage.getConfiguration().get();
|
final var configurationMessage = syncMessage.getConfiguration().get();
|
||||||
final var configurationStore = account.getConfigurationStore();
|
final var configurationStore = account.getConfigurationStore();
|
||||||
configurationStore.setReadReceipts(configurationMessage.getReadReceipts().orNull());
|
if (configurationMessage.getReadReceipts().isPresent()) {
|
||||||
configurationStore.setLinkPreviews(configurationMessage.getLinkPreviews().orNull());
|
configurationStore.setReadReceipts(configurationMessage.getReadReceipts().get());
|
||||||
configurationStore.setTypingIndicators(configurationMessage.getTypingIndicators().orNull());
|
}
|
||||||
configurationStore.setUnidentifiedDeliveryIndicators(configurationMessage.getUnidentifiedDeliveryIndicators()
|
if (configurationMessage.getLinkPreviews().isPresent()) {
|
||||||
.orNull());
|
configurationStore.setLinkPreviews(configurationMessage.getLinkPreviews().get());
|
||||||
|
}
|
||||||
|
if (configurationMessage.getTypingIndicators().isPresent()) {
|
||||||
|
configurationStore.setTypingIndicators(configurationMessage.getTypingIndicators().get());
|
||||||
|
}
|
||||||
|
if (configurationMessage.getUnidentifiedDeliveryIndicators().isPresent()) {
|
||||||
|
configurationStore.setUnidentifiedDeliveryIndicators(configurationMessage.getUnidentifiedDeliveryIndicators()
|
||||||
|
.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue