mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
dont rely on timeline linkage to find events to redact
This commit is contained in:
parent
c97d1d5b05
commit
80ec77a144
1 changed files with 2 additions and 3 deletions
|
@ -364,9 +364,9 @@ module.exports = createReactClass({
|
|||
if (!room) {
|
||||
return;
|
||||
}
|
||||
let timeline = room.getLiveTimeline();
|
||||
const timelineSet = room.getUnfilteredTimelineSet();
|
||||
let eventsToRedact = [];
|
||||
while (timeline) {
|
||||
for (const timeline of timelineSet.getTimelines()) {
|
||||
eventsToRedact = timeline.getEvents().reduce((events, event) => {
|
||||
if (event.getSender() === userId && !event.isRedacted()) {
|
||||
return events.concat(event);
|
||||
|
@ -374,7 +374,6 @@ module.exports = createReactClass({
|
|||
return events;
|
||||
}
|
||||
}, eventsToRedact);
|
||||
timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);
|
||||
}
|
||||
|
||||
const count = eventsToRedact.length;
|
||||
|
|
Loading…
Reference in a new issue