mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +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) {
|
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;
|
||||||
|
|
Loading…
Reference in a new issue