From 5450d6b9cafb2eba2ebb5bdba7e3d03676124a82 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 10 Aug 2017 15:22:53 +0100 Subject: [PATCH] remove redundant check and add comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/shouldHideEvent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shouldHideEvent.js b/src/shouldHideEvent.js index 0eec756390..1501e28875 100644 --- a/src/shouldHideEvent.js +++ b/src/shouldHideEvent.js @@ -16,10 +16,10 @@ function memberEventDiff(ev) { const diff = { - // a Member Event is a State Event and so its State Key must not be undefined. - isMemberEvent: ev.getType() === 'm.room.member' && ev.getStateKey() !== undefined, + isMemberEvent: ev.getType() === 'm.room.member', }; + // If is not a Member Event then the other checks do not apply, so bail early. if (!diff.isMemberEvent) return diff; const content = ev.getContent();