Add Contact and Channelsettings to explicitly enable Picture preview.

This commit is contained in:
ericz committed 2026-08-10 22:21:10 +02:00
1 parent b137dd8fe1
commit d920449cbb
31 files changed
+421 -56

No files matched your search

+10
View File
@@ -33,6 +33,16 @@ class MessageImageHelper {
caseSensitive: false,
);
/// Checks locally whether [text] contains a URL format this helper supports.
/// This deliberately does not resolve sharing pages or fetch image data.
static bool hasPotentialImageUrl(String text) {
return _pyxPattern.hasMatch(text) ||
_ipfsUrlPattern.hasMatch(text) ||
_ipfsCidPattern.hasMatch(text) ||
_ibbSharePattern.hasMatch(text) ||
_imagePattern.hasMatch(text);
}
static Future<String?> parse(String text) async {
final trimmed = text.trim();
if (trimmed.isEmpty) return null;