dont rely on timeline linkage to find events to redact

This commit is contained in:
Bruno Windels 2019-10-02 09:59:37 +02:00
parent c97d1d5b05
commit 80ec77a144

View file

@ -364,9 +364,9 @@ module.exports = createReactClass({
if (!room) { if (!room) {
return; return;
} }
let timeline = room.getLiveTimeline(); const timelineSet = room.getUnfilteredTimelineSet();
let eventsToRedact = []; let eventsToRedact = [];
while (timeline) { for (const timeline of timelineSet.getTimelines()) {
eventsToRedact = timeline.getEvents().reduce((events, event) => { eventsToRedact = timeline.getEvents().reduce((events, event) => {
if (event.getSender() === userId && !event.isRedacted()) { if (event.getSender() === userId && !event.isRedacted()) {
return events.concat(event); return events.concat(event);
@ -374,7 +374,6 @@ module.exports = createReactClass({
return events; return events;
} }
}, eventsToRedact); }, eventsToRedact);
timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);
} }
const count = eventsToRedact.length; const count = eventsToRedact.length;