Skip to content

Commit

Permalink
Fix reactions on edited messages (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
Airyzz authored Jun 25, 2024
1 parent 14bb9b6 commit a9489e0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions commet/lib/client/matrix/matrix_timeline_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class MatrixTimelineEvent implements TimelineEvent {

switch (event.type) {
case matrix.EventTypes.Message:
parseMessage(displayEvent ?? event, client, timeline: timeline);
parseMessage(displayEvent ?? event, client,
timeline: timeline, originalEvent: event);
break;
case matrix.EventTypes.Sticker:
if (timeline != null) parseSticker(event, client, timeline: timeline);
Expand Down Expand Up @@ -231,18 +232,18 @@ class MatrixTimelineEvent implements TimelineEvent {
return EventType.unknown;
}

void parseMessage(matrix.Event matrixEvent, matrix.Client client,
{matrix.Timeline? timeline}) {
handleFormatting(matrixEvent, client);
void parseMessage(matrix.Event displayEvent, matrix.Client client,
{matrix.Timeline? timeline, required matrix.Event originalEvent}) {
handleFormatting(displayEvent, client);

parseAnyAttachments(matrixEvent, client);
parseAnyAttachments(displayEvent, client);
if (timeline != null) {
handleReactions(matrixEvent, timeline);
handleReactions(originalEvent, timeline);
}

// if the message body is the same as a file name we dont want to display that
if (attachments != null &&
attachments!.any((element) => matrixEvent.body == element.name)) {
attachments!.any((element) => displayEvent.body == element.name)) {
body = null;
formattedBody = null;
formattedContent = null;
Expand Down

0 comments on commit a9489e0

Please sign in to comment.