Skip to content

Commit

Permalink
dont rely on timeline linkage to find events to redact
Browse files Browse the repository at this point in the history
  • Loading branch information
bwindels committed Oct 2, 2019
1 parent c8c4dc2 commit 37f3acb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/views/rooms/MemberInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,16 @@ 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);
} else {
return events;
}
}, eventsToRedact);
timeline = timeline.getNeighbouringTimeline(EventTimeline.BACKWARDS);
}

const count = eventsToRedact.length;
Expand Down

0 comments on commit 37f3acb

Please sign in to comment.