No third-party fetch without asking: gate GIFs, hide ML settings
build / build (push) Successful in 17m17s
build / build (push) Successful in 17m17s
- GifMessage gets autoLoad; chats pass their "images from URLs" switch (off by default), so a received GIF code no longer fetches from Giphy until tapped. Reply quotes follow the channel setting. - Translation and image-message settings are hidden (kOnDeviceMl in lib/tth_fork.dart): without the native runtimes they cannot work and their buttons would only download models of up to 835 MB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
59b64291c4
commit
bfb3ef6128
6 files changed
+43
-8
No files matched your search
@@ -10,12 +10,17 @@ class GifMessage extends StatefulWidget {
|
||||
final Color fallbackTextColor;
|
||||
final double maxSize;
|
||||
|
||||
/// False: show "tap to load" and fetch only on tap (tth fork, no
|
||||
/// third-party request without the user asking for it).
|
||||
final bool autoLoad;
|
||||
|
||||
const GifMessage({
|
||||
super.key,
|
||||
required this.url,
|
||||
required this.backgroundColor,
|
||||
required this.fallbackTextColor,
|
||||
this.maxSize = 200,
|
||||
this.autoLoad = true,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -33,7 +38,11 @@ class _GifMessageState extends State<GifMessage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_resolveImage();
|
||||
if (widget.autoLoad) {
|
||||
_resolveImage();
|
||||
} else {
|
||||
_isLoading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -45,7 +54,13 @@ class _GifMessageState extends State<GifMessage> {
|
||||
_error = null;
|
||||
_isLoading = true;
|
||||
_isPaused = false;
|
||||
_resolveImage();
|
||||
if (widget.autoLoad) {
|
||||
_resolveImage();
|
||||
} else {
|
||||
_isLoading = false;
|
||||
}
|
||||
} else if (widget.autoLoad && !oldWidget.autoLoad && _image == null) {
|
||||
_retryLoad();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user