Skip to content

Commit

Permalink
fail to enable encryption on limited cache_level
Browse files Browse the repository at this point in the history
Encryption shouldn't be supported on limited cache_level. Even if it may
work a bit, it causes a lot of data to be cached.
  • Loading branch information
Zil0 committed Aug 10, 2018
1 parent 11769ba commit 4ff57d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions matrix_client/client.py
Expand Up @@ -132,6 +132,9 @@ def __init__(self, base_url, token=None, user_id=None,
if restore_device_id and not encryption:
raise ValueError("restore_device_id only makes sense when encryption is "
"enabled.")
if encryption and cache_level != CACHE.ALL:
raise ValueError("Encryption is unvailable on cache_level other than "
"CACHE.ALL.")

self.api = MatrixHttpApi(base_url, token)
self.api.validate_certificate(valid_cert_check)
Expand Down

0 comments on commit 4ff57d4

Please sign in to comment.