forked from Nexus/nexus
fix reactions on edited messages
This commit is contained in:
parent
f997e257a2
commit
6b8eef3f17
1 changed files with 6 additions and 4 deletions
|
|
@ -15,8 +15,8 @@ class MessageController extends AsyncNotifier<Message?> {
|
||||||
@override
|
@override
|
||||||
Future<Message?> build() async {
|
Future<Message?> build() async {
|
||||||
try {
|
try {
|
||||||
if ((config.event.relationType == "m.replace" && !config.includeEdits) ||
|
final isEdit = config.event.relationType == "m.replace";
|
||||||
config.room.metadata == null) {
|
if ((isEdit && !config.includeEdits) || config.room.metadata == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,14 +68,16 @@ class MessageController extends AsyncNotifier<Message?> {
|
||||||
final replyId =
|
final replyId =
|
||||||
config.event.content["m.relates_to"]?["m.in_reply_to"]?["event_id"];
|
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
|
? null
|
||||||
: await ref
|
: await ref
|
||||||
.watch(ClientController.provider.notifier)
|
.watch(ClientController.provider.notifier)
|
||||||
.getRelatedEvents(
|
.getRelatedEvents(
|
||||||
GetRelatedEventsRequest(
|
GetRelatedEventsRequest(
|
||||||
roomId: config.room.metadata!.id,
|
roomId: config.room.metadata!.id,
|
||||||
eventId: config.event.eventId,
|
eventId:
|
||||||
|
(isEdit ? config.event.relatesTo : null) ??
|
||||||
|
config.event.eventId,
|
||||||
relationType: "m.annotation",
|
relationType: "m.annotation",
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue