From 3d2a9704570a205362b31ab1aaa68f3f5723788c Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 23 Jun 2016 18:19:59 +0100 Subject: [PATCH] Check m.room.encryption is a state event - just to be paranoid. --- lib/client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.js b/lib/client.js index b4932c3f4..5c007db15 100644 --- a/lib/client.js +++ b/lib/client.js @@ -641,7 +641,7 @@ MatrixClient.prototype.isEventSenderVerified = function(event) { */ function setupCryptoEventHandler(client) { client.on("event", function(event) { - if (event.getType() != "m.room.encryption") { + if (!event.isState() || event.getType() != "m.room.encryption") { return; } onCryptoEvent(client, event);