mirror of https://github.com/vector-im/riot-web
EventIndex: Split out the statements that check for a valid event type.
parent
156c6b8db8
commit
7f71e551da
|
@ -251,13 +251,8 @@ export default class EventIndex extends EventEmitter {
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
isValidEvent(ev) {
|
isValidEvent(ev) {
|
||||||
const validEventType = ([
|
const isUsefulType = ["m.room.message", "m.room.name", "m.room.topic"].includes(ev.getType());
|
||||||
"m.room.message",
|
const validEventType = isUsefulType && !ev.isRedacted() && !ev.isDecryptionFailure();
|
||||||
"m.room.name",
|
|
||||||
"m.room.topic",
|
|
||||||
].indexOf(ev.getType()) >= 0
|
|
||||||
&& !ev.isRedacted() && !ev.isDecryptionFailure()
|
|
||||||
);
|
|
||||||
|
|
||||||
let validMsgType = true;
|
let validMsgType = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue