From 657883436f026a09fca32d7d43853a170ec5286c Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Thu, 4 Dec 2025 20:20:23 -0500 Subject: [PATCH] add some more info on stuff --- README.md | 1 + lib/helpers/extensions/event_to_message.dart | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 2ef0f18..4237469 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ A simple and user-friendly Matrix client made with Flutter and the Matrix Dart S - [x] Backwards - [ ] Forwards - [ ] Fix bug with message order for out-of-chunk edits (would be easy if we had https://forgejo.ellis.link/continuwuation/continuwuity/pulls/847) + - I left a bounty on this, hopefully it can get resolved quickly - [x] Editing - [x] Deleting - [ ] Reactions: Waiting on https://github.com/flyerhq/flutter_chat_ui/pull/838 diff --git a/lib/helpers/extensions/event_to_message.dart b/lib/helpers/extensions/event_to_message.dart index 41fbb8e..4fd23eb 100644 --- a/lib/helpers/extensions/event_to_message.dart +++ b/lib/helpers/extensions/event_to_message.dart @@ -1,5 +1,6 @@ import "package:flutter/foundation.dart"; import "package:flutter_chat_core/flutter_chat_core.dart"; +import "package:flutter_link_previewer/flutter_link_previewer.dart"; import "package:matrix/matrix.dart"; extension EventToMessage on Event { @@ -31,6 +32,20 @@ extension EventToMessage on Event { if (redacted && !mustBeText) return null; + // TODO: Why does the SDK not return og:title and og:description? + // TODO: It's maybe because spec isn't clear on this, the example + // TODO: has all the info we need, but the table only shows + // TODO: `matrix:image:size` and `og:image`, the same as the SDK + // TODO: returns. I could maybe PR a fix to the SDK. + + // final match = Uri.tryParse( + // RegExp(regexLink, caseSensitive: false).firstMatch(body)?.group(0) ?? "", + // ); + + // final preview = match == null + // ? null + // : await room.client.getUrlPreviewAuthed(match); + final asText = Message.text( metadata: metadata,