EventIndex: Split out the statements that check for a valid event type.
This commit is contained in:
parent
156c6b8db8
commit
7f71e551da
1 changed files with 2 additions and 7 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue