make hide joins/parts work for MELS and highlighted/permalink event

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-06-15 19:53:34 +01:00
parent c1cbdbcc4f
commit a0a4fe62d5
1 changed files with 5 additions and 2 deletions

View File

@ -241,12 +241,15 @@ module.exports = React.createClass({
// TODO: Implement granular (per-room) hide options
_shouldShowEvent: function(mxEv) {
console.log("_shouldShowEvent " + mxEv.getId());
console.log("_shouldShowEvent ", mxEv.getId(), mxEv);
const EventTile = sdk.getComponent('rooms.EventTile');
if (!EventTile.haveTileForEvent(mxEv)) {
return false; // no tile = no show
}
// Always show highlighted event
if (this.props.highlightedEventId === mxEv.getId()) return true;
const isMemberEvent = mxEv.getType() === "m.room.member" && mxEv.getStateKey() !== undefined;
if (!isMemberEvent) {
return true; // bail early: all the checks below concern member events only
@ -365,7 +368,7 @@ module.exports = React.createClass({
let collapsedMxEv = this.props.events[i + 1];
// Ignore redacted member events
if (!EventTile.haveTileForEvent(collapsedMxEv)) {
if (!EventTile.haveTileForEvent(collapsedMxEv) || !this._shouldShowEvent(collapsedMxEv)) {
continue;
}