summary refs log tree commit diff
path: root/synapse/types.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/types.py')
-rw-r--r--synapse/types.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/types.py b/synapse/types.py

index eebe29d1f0..e6afc05cee 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -16,6 +16,8 @@ import re import string from collections import namedtuple +from six.moves import filter + import attr from synapse.api.errors import SynapseError @@ -240,7 +242,8 @@ def strip_invalid_mxid_characters(localpart): Returns: localpart (basestring): the localpart having been stripped """ - return filter(lambda c: c in mxid_localpart_allowed_characters, localpart) + filtered = filter(lambda c: c in mxid_localpart_allowed_characters, localpart) + return "".join(filtered) UPPER_CASE_PATTERN = re.compile(b"[A-Z_]")