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

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 8, 2019
1 parent c97d1d5 commit 80ec77a
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 80ec77a

Please sign in to comment.