You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
make hide joins/parts work for MELS and highlighted/permalink event
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@ -241,12 +241,15 @@ module.exports = React.createClass({
|
|||||||
|
|
||||||
// TODO: Implement granular (per-room) hide options
|
// TODO: Implement granular (per-room) hide options
|
||||||
_shouldShowEvent: function(mxEv) {
|
_shouldShowEvent: function(mxEv) {
|
||||||
console.log("_shouldShowEvent " + mxEv.getId());
|
console.log("_shouldShowEvent ", mxEv.getId(), mxEv);
|
||||||
const EventTile = sdk.getComponent('rooms.EventTile');
|
const EventTile = sdk.getComponent('rooms.EventTile');
|
||||||
if (!EventTile.haveTileForEvent(mxEv)) {
|
if (!EventTile.haveTileForEvent(mxEv)) {
|
||||||
return false; // no tile = no show
|
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;
|
const isMemberEvent = mxEv.getType() === "m.room.member" && mxEv.getStateKey() !== undefined;
|
||||||
if (!isMemberEvent) {
|
if (!isMemberEvent) {
|
||||||
return true; // bail early: all the checks below concern member events only
|
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];
|
let collapsedMxEv = this.props.events[i + 1];
|
||||||
|
|
||||||
// Ignore redacted member events
|
// Ignore redacted member events
|
||||||
if (!EventTile.haveTileForEvent(collapsedMxEv)) {
|
if (!EventTile.haveTileForEvent(collapsedMxEv) || !this._shouldShowEvent(collapsedMxEv)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user