diff --git a/lib/controllers/message_controller.dart b/lib/controllers/message_controller.dart index 51f94fe..c65d18d 100644 --- a/lib/controllers/message_controller.dart +++ b/lib/controllers/message_controller.dart @@ -15,8 +15,8 @@ class MessageController extends AsyncNotifier { @override Future build() async { try { - if ((config.event.relationType == "m.replace" && !config.includeEdits) || - config.room.metadata == null) { + final isEdit = config.event.relationType == "m.replace"; + if ((isEdit && !config.includeEdits) || config.room.metadata == null) { return null; } @@ -68,14 +68,16 @@ class MessageController extends AsyncNotifier { final replyId = config.event.content["m.relates_to"]?["m.in_reply_to"]?["event_id"]; - final reactionEvents = event.reactions.isEmpty + final reactionEvents = config.event.reactions.isEmpty && !isEdit ? null : await ref .watch(ClientController.provider.notifier) .getRelatedEvents( GetRelatedEventsRequest( roomId: config.room.metadata!.id, - eventId: config.event.eventId, + eventId: + (isEdit ? config.event.relatesTo : null) ?? + config.event.eventId, relationType: "m.annotation", ), );