Fix instances of event.sender being read for just the userId - this field may not be set in time

This commit is contained in:
Michael Telatynski 2021-07-15 17:43:24 +01:00
parent 376533e709
commit b0053f36d3
4 changed files with 7 additions and 10 deletions

View file

@ -401,7 +401,7 @@ export default class MessagePanel extends React.Component<IProps, IState> {
// TODO: Implement granular (per-room) hide options
public shouldShowEvent(mxEv: MatrixEvent): boolean {
if (mxEv.sender && MatrixClientPeg.get().isUserIgnored(mxEv.sender.userId)) {
if (MatrixClientPeg.get().isUserIgnored(mxEv.getSender())) {
return false; // ignored = no show (only happens if the ignore happens after an event was received)
}