Compare commits

...

4 Commits

Author SHA1 Message Date
Michael Telatynski
9cf2d901c7 Merge branches 'develop' and 't3chguy/fix_contains-url_filtering' of github.com:matrix-org/synapse into t3chguy/fix_contains-url_filtering 2018-08-01 22:53:56 +01:00
Michael Telatynski
c0e468b543 apply PR feedback
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-07-29 19:31:11 +01:00
Michael Telatynski
73582c6bc7 make linter happy
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-17 13:05:16 +01:00
Michael Telatynski
c7e2c01248 fix the check for whether is_url to match all the other ones in codebase
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2018-06-17 11:41:47 +01:00

View File

@@ -12,6 +12,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import six
import ujson as json
import jsonschema
from canonicaljson import json
from jsonschema import FormatChecker
@@ -364,7 +367,10 @@ class Filter(object):
room_id = event.get("room_id", None)
ev_type = event.get("type", None)
is_url = "url" in event.get("content", {})
content = event.get("content", {})
# check if there is a string url field in the content for filtering purposes
is_url = isinstance(content.get("url"), six.text_type)
return self.check_fields(
room_id,