diff --git a/src/indexing/EventIndex.js b/src/indexing/EventIndex.js index 1d85d83f07..c8a9a4c1fa 100644 --- a/src/indexing/EventIndex.js +++ b/src/indexing/EventIndex.js @@ -251,13 +251,8 @@ export default class EventIndex extends EventEmitter { * otherwise. */ isValidEvent(ev) { - const validEventType = ([ - "m.room.message", - "m.room.name", - "m.room.topic", - ].indexOf(ev.getType()) >= 0 - && !ev.isRedacted() && !ev.isDecryptionFailure() - ); + const isUsefulType = ["m.room.message", "m.room.name", "m.room.topic"].includes(ev.getType()); + const validEventType = isUsefulType && !ev.isRedacted() && !ev.isDecryptionFailure(); let validMsgType = true;