From d9addf84ef98385bb895d320c8b10ff28a34cddf Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 16 Oct 2017 13:55:07 +0100 Subject: [PATCH] Make unknown pushrule conditions not match Unknown conditions previously were assumed to match, but given rules can be added on the server as base rules, it's probably better to not match unknown conditions. --- src/pushprocessor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pushprocessor.js b/src/pushprocessor.js index 5b35ccdf4..ebb1383fd 100644 --- a/src/pushprocessor.js +++ b/src/pushprocessor.js @@ -1,5 +1,6 @@ /* Copyright 2015, 2016 OpenMarket Ltd +Copyright 2017 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -126,7 +127,10 @@ function PushProcessor(client) { if (condition_functions[cond.kind]) { return condition_functions[cond.kind](cond, ev); } - return true; + // unknown conditions: we previously matched all unknown conditions, + // but given that rules can be added to the base rules on a server, + // it's probably better to not match unknown conditions. + return false; }; const eventFulfillsRoomMemberCountCondition = function(cond, ev) {