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
@@ -697,6 +697,22 @@ class AppSettingsScreen extends StatelessWidget {
|
||||
onChanged: settingsService.setLoadLinkImages,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
SwitchListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 4,
|
||||
),
|
||||
secondary: const Icon(Icons.collections_outlined, size: 24),
|
||||
title: Text(context.l10n.appSettings_showLinkImagesByDefault),
|
||||
subtitle: Text(
|
||||
context.l10n.appSettings_showLinkImagesByDefaultSubtitle,
|
||||
),
|
||||
value: settingsService.settings.showLinkImagesByDefault,
|
||||
onChanged: settingsService.settings.loadLinkImages
|
||||
? settingsService.setShowLinkImagesByDefault
|
||||
: null,
|
||||
),
|
||||
const Divider(height: 1, indent: 16),
|
||||
ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
|
||||
@@ -1649,7 +1649,10 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
);
|
||||
bool smazEnabled = connector.isChannelSmazEnabled(channel.index);
|
||||
bool cyr2latEnabled = connector.isChannelCyr2LatEnabled(channel.index);
|
||||
bool urlImagesEnabled = connector.isChannelUrlImagesEnabled(channel.index);
|
||||
final initialUrlImagesEnabled = connector.isChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
);
|
||||
bool urlImagesEnabled = initialUrlImagesEnabled;
|
||||
final loadLinkImages = appSettingsService.settings.loadLinkImages;
|
||||
String? selectedCyr2LatProfileId = connector.getChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
@@ -1842,10 +1845,13 @@ class _ChannelsScreenState extends State<ChannelsScreen>
|
||||
channel.index,
|
||||
cyr2latEnabled,
|
||||
);
|
||||
await connector.setChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
urlImagesEnabled,
|
||||
);
|
||||
if (urlImagesEnabled !=
|
||||
initialUrlImagesEnabled) {
|
||||
await connector.setChannelUrlImagesEnabled(
|
||||
channel.index,
|
||||
urlImagesEnabled,
|
||||
);
|
||||
}
|
||||
await connector.setChannelCyr2LatProfileId(
|
||||
channel.index,
|
||||
selectedCyr2LatProfileId,
|
||||
|
||||
Reference in new issue
Block a user