summaryrefslogtreecommitdiff
path: root/synapse/state
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-12-20 15:15:36 +0000
committerRichard van der Hoff <richard@matrix.org>2018-12-20 15:15:36 +0000
commitfba5afbcd406695f1b039c86f2b0174ce5bf1ce9 (patch)
tree235fba045bb7f636ed48fd72ba541166ab13c6af /synapse/state
parentda91dde24c0eb0fc5c596cb1135c1d8574f8e8c3 (diff)
New upstream version 0.34.0
Diffstat (limited to 'synapse/state')
-rw-r--r--synapse/state/v1.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/state/v1.py b/synapse/state/v1.py
index 70a981f4..19e091ce 100644
--- a/synapse/state/v1.py
+++ b/synapse/state/v1.py
@@ -298,6 +298,8 @@ def _resolve_normal_events(events, auth_events):
def _ordered_events(events):
def key_func(e):
- return -int(e.depth), hashlib.sha1(e.event_id.encode('ascii')).hexdigest()
+ # we have to use utf-8 rather than ascii here because it turns out we allow
+ # people to send us events with non-ascii event IDs :/
+ return -int(e.depth), hashlib.sha1(e.event_id.encode('utf-8')).hexdigest()
return sorted(events, key=key_func)