Fix up Add setting to default to cache or shared storage
Some checks failed
Android CI / build (pull_request) Has been cancelled

This commit is contained in:
Arne 2025-01-27 16:22:18 +01:00
parent 91d45f18a9
commit ecb8cd98ad
3 changed files with 11 additions and 3 deletions

View file

@ -536,7 +536,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
this.binding.showMedia.setOnClickListener((v) -> MediaBrowserActivity.launch(this, mConversation));
}
binding.storeInCache.setChecked(mConversation.storeInCache());
if (xmppConnectionService != null && xmppConnectionService.getBooleanPreference("default_store_media_in_cache", R.bool.default_store_media_in_cache)) {
binding.storeInCache.setChecked(true);
} else {
binding.storeInCache.setChecked(mConversation.storeInCache());
}
binding.storeInCache.setOnCheckedChangeListener((v, checked) -> {
mConversation.setStoreInCache(checked);
xmppConnectionService.updateConversation(mConversation);

View file

@ -775,7 +775,11 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
});
final var conversation = xmppConnectionService.findOrCreateConversation(account, contact.getJid(), false, true);
binding.storeInCache.setChecked(conversation.storeInCache());
if (xmppConnectionService != null && xmppConnectionService.getBooleanPreference("default_store_media_in_cache", R.bool.default_store_media_in_cache)) {
binding.storeInCache.setChecked(true);
} else {
binding.storeInCache.setChecked(conversation.storeInCache());
}
binding.storeInCache.setOnCheckedChangeListener((v, checked) -> {
conversation.setStoreInCache(checked);
xmppConnectionService.updateConversation(conversation);

View file

@ -1423,5 +1423,5 @@
<string name="pref_swipe_to_archive_summary">Swipe left or right in the chats overview to archive a chat</string>
<string name="set_preferences_title">Set preferences</string>
<string name="set_preferences_summary">Here you can change the default settings for some of the most important preferences before you login to enhance your privacy or security. You can change them all again after you logged in.</string>
<string name="pref_store_media_in_cache">Default systemwide to store media in cache only. This doesn\'t change the single per chat setting inside the chat details.</string>
<string name="pref_store_media_in_cache">Default system wide to store media in cache only.</string>
</resources>