Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #5799 from matrix-org/t3chguy/redaction-groupere
Browse files Browse the repository at this point in the history
[Release] Fix edge case with redaction grouper messing up continuations
  • Loading branch information
t3chguy authored Mar 25, 2021
2 parents 9e2edd7 + 7696528 commit 1f4437a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/structures/MessagePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function shouldFormContinuation(prevEvent, mxEvent) {
// check if within the max continuation period
if (mxEvent.getTs() - prevEvent.getTs() > CONTINUATION_MAX_INTERVAL) return false;

// As we summarise redactions, do not continue a redacted event onto a non-redacted one and vice-versa
if (mxEvent.isRedacted() !== prevEvent.isRedacted()) return false;

// Some events should appear as continuations from previous events of different types.
if (mxEvent.getType() !== prevEvent.getType() &&
(!continuedTypes.includes(mxEvent.getType()) ||
Expand Down Expand Up @@ -1125,7 +1128,7 @@ class RedactionGrouper {
}

getNewPrevEvent() {
return this.events[0];
return this.events[this.events.length - 1];
}
}

Expand Down

0 comments on commit 1f4437a

Please sign in to comment.