Merge pull request #4573 from matrix-org/t3chguy/remove_recent_self

Don't try and redact redactions for "Remove recent messages"
This commit is contained in:
Michael Telatynski 2020-05-12 09:43:23 +01:00 committed by GitHub
commit b95d533c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -557,7 +557,7 @@ const RedactMessagesButton = ({member}) => {
let eventsToRedact = []; let eventsToRedact = [];
while (timeline) { while (timeline) {
eventsToRedact = timeline.getEvents().reduce((events, event) => { eventsToRedact = timeline.getEvents().reduce((events, event) => {
if (event.getSender() === userId && !event.isRedacted()) { if (event.getSender() === userId && !event.isRedacted() && !event.isRedaction()) {
return events.concat(event); return events.concat(event);
} else { } else {
return events; return events;

View file

@ -364,7 +364,7 @@ export default createReactClass({
let eventsToRedact = []; let eventsToRedact = [];
for (const timeline of timelineSet.getTimelines()) { 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() && !event.isRedaction()) {
return events.concat(event); return events.concat(event);
} else { } else {
return events; return events;