From dbebb7feede8e463e722a1c880d21a7bca484150 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 8 Apr 2024 08:20:08 +0200 Subject: [PATCH] trigger endpoint renewal when up settings change --- .../ui/fragment/settings/UpSettingsFragment.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java b/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java index 3470e98c3..7ab15e21e 100644 --- a/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/fragment/settings/UpSettingsFragment.java @@ -7,7 +7,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.preference.EditTextPreference; import androidx.preference.ListPreference; -import androidx.preference.Preference; import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; @@ -91,6 +90,17 @@ public class UpSettingsFragment extends XmppPreferenceFragment { } } + @Override + protected void onSharedPreferenceChanged(@NonNull String key) { + super.onSharedPreferenceChanged(key); + if (UnifiedPushDistributor.PREFERENCES.contains(key)) { + final var service = requireService(); + if (service.reconfigurePushDistributor()) { + service.renewUnifiedPushEndpoints(); + } + } + } + @Override public void onStart() { super.onStart();