remove redundant check and add comment

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2017-08-10 15:22:53 +01:00
parent 625ca96d86
commit 5450d6b9ca
No known key found for this signature in database
GPG Key ID: 0435A1D4BBD34D64
1 changed files with 2 additions and 2 deletions

View File

@ -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();