Merge pull request #609 from matrix-org/luke/fix-join-part-collapsing-redacted-joins

Fix redacted member events being visible
This commit is contained in:
David Baker 2017-01-11 17:10:35 +00:00 committed by GitHub
commit 1f96467145

View File

@ -295,8 +295,8 @@ module.exports = React.createClass({
var last = (i == lastShownEventIndex); var last = (i == lastShownEventIndex);
// Wrap consecutive member events in a ListSummary // Wrap consecutive member events in a ListSummary, ignore if redacted
if (isMembershipChange(mxEv)) { if (isMembershipChange(mxEv) && EventTile.haveTileForEvent(mxEv)) {
let ts1 = mxEv.getTs(); let ts1 = mxEv.getTs();
// Ensure that the key of the MemberEventListSummary does not change with new // Ensure that the key of the MemberEventListSummary does not change with new
// member events. This will prevent it from being re-created unnecessarily, and // member events. This will prevent it from being re-created unnecessarily, and
@ -317,6 +317,11 @@ module.exports = React.createClass({
for (;i + 1 < this.props.events.length; i++) { for (;i + 1 < this.props.events.length; i++) {
let collapsedMxEv = this.props.events[i + 1]; let collapsedMxEv = this.props.events[i + 1];
// Ignore redacted member events
if (!EventTile.haveTileForEvent(collapsedMxEv)) {
continue;
}
if (!isMembershipChange(collapsedMxEv) || if (!isMembershipChange(collapsedMxEv) ||
this._wantsDateSeparator(this.props.events[i], collapsedMxEv.getDate())) { this._wantsDateSeparator(this.props.events[i], collapsedMxEv.getDate())) {
break; break;