mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +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()) {
|
||||
final var configurationMessage = syncMessage.getConfiguration().get();
|
||||
final var configurationStore = account.getConfigurationStore();
|
||||
configurationStore.setReadReceipts(configurationMessage.getReadReceipts().orNull());
|
||||
configurationStore.setLinkPreviews(configurationMessage.getLinkPreviews().orNull());
|
||||
configurationStore.setTypingIndicators(configurationMessage.getTypingIndicators().orNull());
|
||||
if (configurationMessage.getReadReceipts().isPresent()) {
|
||||
configurationStore.setReadReceipts(configurationMessage.getReadReceipts().get());
|
||||
}
|
||||
if (configurationMessage.getLinkPreviews().isPresent()) {
|
||||
configurationStore.setLinkPreviews(configurationMessage.getLinkPreviews().get());
|
||||
}
|
||||
if (configurationMessage.getTypingIndicators().isPresent()) {
|
||||
configurationStore.setTypingIndicators(configurationMessage.getTypingIndicators().get());
|
||||
}
|
||||
if (configurationMessage.getUnidentifiedDeliveryIndicators().isPresent()) {
|
||||
configurationStore.setUnidentifiedDeliveryIndicators(configurationMessage.getUnidentifiedDeliveryIndicators()
|
||||
.orNull());
|
||||
.get());
|
||||
}
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue