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

Commit 15e7559

Browse files
authored
Merge pull request #3508 from matrix-org/bwindels/redact-all-more-robust
Make "remove recent messages" more robust
2 parents c97d1d5 + 6bb303c commit 15e7559

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/components/views/rooms/MemberInfo.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,17 +364,16 @@ module.exports = createReactClass({
364364
if (!room) {
365365
return;
366366
}
367-
let timeline = room.getLiveTimeline();
367+
const timelineSet = room.getUnfilteredTimelineSet();
368368
let eventsToRedact = [];
369-
while (timeline) {
369+
for (const timeline of timelineSet.getTimelines()) {
370370
eventsToRedact = timeline.getEvents().reduce((events, event) => {
371371
if (event.getSender() === userId && !event.isRedacted()) {
372372
return events.concat(event);
373373
} else {
374374
return events;
375375
}
376376
}, eventsToRedact);
377-
timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);
378377
}
379378

380379
const count = eventsToRedact.length;

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,8 +806,10 @@
806806
"Try scrolling up in the timeline to see if there are any earlier ones.": "Try scrolling up in the timeline to see if there are any earlier ones.",
807807
"Remove recent messages by %(user)s": "Remove recent messages by %(user)s",
808808
"You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|other": "You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?",
809+
"You are about to remove %(count)s messages by %(user)s. This cannot be undone. Do you wish to continue?|one": "You are about to remove 1 message by %(user)s. This cannot be undone. Do you wish to continue?",
809810
"For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.": "For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.",
810811
"Remove %(count)s messages|other": "Remove %(count)s messages",
812+
"Remove %(count)s messages|one": "Remove 1 message",
811813
"Demote yourself?": "Demote yourself?",
812814
"You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.": "You will not be able to undo this change as you are demoting yourself, if you are the last privileged user in the room it will be impossible to regain privileges.",
813815
"Demote": "Demote",

0 commit comments

Comments
 (0)