refactor: Use more robust and performant way to detect single emoji messages

This commit is contained in:
Christian Kußowski 2026-02-27 19:08:27 +01:00
commit f0aa15843b
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
4 changed files with 18 additions and 3 deletions

View file

@ -104,6 +104,8 @@ class ChatController extends State<ChatPageWithRoom>
String? activeThreadId;
late final Set<String> bigEmojis;
late final String readMarkerEventId;
String get roomId => widget.room.id;
@ -360,6 +362,14 @@ class ChatController extends State<ChatPageWithRoom>
AppSettings.displayChatDetailsColumn.value,
);
bigEmojis = defaultEmojiSet.fold(
<String>{},
(emojis, category) => {
...emojis,
...(category.emoji.map((emoji) => emoji.emoji)),
},
);
sendingClient = Matrix.of(context).client;
final lastEventThreadId =
room.lastEvent?.relationshipType == RelationshipTypes.thread