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

Commit 5e3a7c4

Browse files
committed
Fix edge case with redaction grouper messing up continuations
1 parent da7d31a commit 5e3a7c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/structures/MessagePanel.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ function shouldFormContinuation(prevEvent, mxEvent) {
4646
// check if within the max continuation period
4747
if (mxEvent.getTs() - prevEvent.getTs() > CONTINUATION_MAX_INTERVAL) return false;
4848

49+
// As we summarise redactions, do not continue a redacted event onto a non-redacted one and vice-versa
50+
if (mxEvent.isRedacted() !== prevEvent.isRedacted()) return false;
51+
4952
// Some events should appear as continuations from previous events of different types.
5053
if (mxEvent.getType() !== prevEvent.getType() &&
5154
(!continuedTypes.includes(mxEvent.getType()) ||
@@ -1125,7 +1128,7 @@ class RedactionGrouper {
11251128
}
11261129

11271130
getNewPrevEvent() {
1128-
return this.events[0];
1131+
return this.events[this.events.length - 1];
11291132
}
11301133
}
11311134

0 commit comments

Comments
 (0)