diff options
author | David Vo <auscompgeek@users.noreply.github.com> | 2020-08-07 22:02:55 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-07 08:02:55 -0400 |
commit | 4dd27e6d1125df83a754b5e0c2c14aaafc0ce837 (patch) | |
tree | db0e46cd9c3f2f94cedb200d5599a4b4d61651de /synapse/storage/databases/main/e2e_room_keys.py | |
parent | Revert #7736 (#8039) (diff) | |
download | synapse-4dd27e6d1125df83a754b5e0c2c14aaafc0ce837.tar.xz |
Reduce unnecessary whitespace in JSON. (#7372)
Diffstat (limited to 'synapse/storage/databases/main/e2e_room_keys.py')
-rw-r--r-- | synapse/storage/databases/main/e2e_room_keys.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/synapse/storage/databases/main/e2e_room_keys.py b/synapse/storage/databases/main/e2e_room_keys.py index 90152edc3c..c4aaec3993 100644 --- a/synapse/storage/databases/main/e2e_room_keys.py +++ b/synapse/storage/databases/main/e2e_room_keys.py @@ -14,13 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -from canonicaljson import json - from twisted.internet import defer from synapse.api.errors import StoreError from synapse.logging.opentracing import log_kv, trace from synapse.storage._base import SQLBaseStore, db_to_json +from synapse.util import json_encoder class EndToEndRoomKeyStore(SQLBaseStore): @@ -50,7 +49,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): "first_message_index": room_key["first_message_index"], "forwarded_count": room_key["forwarded_count"], "is_verified": room_key["is_verified"], - "session_data": json.dumps(room_key["session_data"]), + "session_data": json_encoder.encode(room_key["session_data"]), }, desc="update_e2e_room_key", ) @@ -77,7 +76,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): "first_message_index": room_key["first_message_index"], "forwarded_count": room_key["forwarded_count"], "is_verified": room_key["is_verified"], - "session_data": json.dumps(room_key["session_data"]), + "session_data": json_encoder.encode(room_key["session_data"]), } ) log_kv( @@ -360,7 +359,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): "user_id": user_id, "version": new_version, "algorithm": info["algorithm"], - "auth_data": json.dumps(info["auth_data"]), + "auth_data": json_encoder.encode(info["auth_data"]), }, ) @@ -387,7 +386,7 @@ class EndToEndRoomKeyStore(SQLBaseStore): updatevalues = {} if info is not None and "auth_data" in info: - updatevalues["auth_data"] = json.dumps(info["auth_data"]) + updatevalues["auth_data"] = json_encoder.encode(info["auth_data"]) if version_etag is not None: updatevalues["etag"] = version_etag |