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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/types.py b/synapse/types.py

index 13cdc737fb..e4eddbacef 100644 --- a/synapse/types.py +++ b/synapse/types.py
@@ -19,7 +19,7 @@ from collections import namedtuple from unpaddedbase64 import encode_base64, decode_base64 import ujson as json - +import msgpack Requester = namedtuple("Requester", ["user", "access_token_id", "is_guest"]) @@ -127,7 +127,7 @@ class SyncNextBatchToken( @classmethod def from_string(cls, string): try: - d = json.loads(decode_base64(string)) + d = msgpack.loads(decode_base64(string)) pa = d.get("pa", None) if pa: pa = SyncPaginationState.from_dict(pa) @@ -139,7 +139,7 @@ class SyncNextBatchToken( raise SynapseError(400, "Invalid Token") def to_string(self): - return encode_base64(json.dumps({ + return encode_base64(msgpack.dumps({ "t": self.stream_token.to_arr(), "pa": self.pagination_state.to_dict() if self.pagination_state else None, }))