Add a setting to show link images in all chats by default
'Show link images in all chats by default' (default off) applies to every channel and contact without an explicit per-chat choice: the per-chat setting is now unset/on/off and resolves to perChat ?? default. The 'Load images from links' master switch still overrides it.
This commit is contained in:
1 parent
79e3668c18
commit
a4670a9275
30 files changed
+330
-16
No files matched your search
@@ -60,14 +60,14 @@ class ChannelSettingsStore {
|
||||
await PrefsManager.instance.setBool(_cyr2LatKey(channelId), enabled);
|
||||
}
|
||||
|
||||
Future<bool> loadUrlImagesEnabled(String channelId) async {
|
||||
Future<bool?> loadUrlImagesEnabled(String channelId) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot load channel URL image settings.',
|
||||
);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
return PrefsManager.instance.getBool(_urlImagesKey(channelId)) ?? false;
|
||||
return PrefsManager.instance.getBool(_urlImagesKey(channelId));
|
||||
}
|
||||
|
||||
Future<void> saveUrlImagesEnabled(String channelId, bool enabled) async {
|
||||
|
||||
@@ -76,16 +76,16 @@ class ContactSettingsStore {
|
||||
await prefs.setBool(key, enabled);
|
||||
}
|
||||
|
||||
Future<bool> loadUrlImagesEnabled(String contactKeyHex) async {
|
||||
Future<bool?> loadUrlImagesEnabled(String contactKeyHex) async {
|
||||
if (publicKeyHex.isEmpty) {
|
||||
appLogger.warn(
|
||||
'Public key hex is not set. Cannot load contact URL image settings.',
|
||||
);
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
final prefs = PrefsManager.instance;
|
||||
final key = '$keyForUrlImages$contactKeyHex';
|
||||
return prefs.getBool(key) ?? false;
|
||||
return prefs.getBool(key);
|
||||
}
|
||||
|
||||
Future<void> saveUrlImagesEnabled(String contactKeyHex, bool enabled) async {
|
||||
|
||||
Reference in new issue
Block a user