diff options
author | Erik Johnston <erik@matrix.org> | 2019-05-16 14:24:58 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-05-16 14:26:23 +0100 |
commit | 7a7eba8302d6566c044ca82c8ac0da65aa85e36b (patch) | |
tree | b4584277b4404429f290824e37f8807d772cc0b3 /synapse/storage | |
parent | Indirect tuple conversion (diff) | |
download | synapse-7a7eba8302d6566c044ca82c8ac0da65aa85e36b.tar.xz |
Move parsing of tokens out of storage layer
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/relations.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/synapse/storage/relations.py b/synapse/storage/relations.py index 996cb6903a..de67e305a1 100644 --- a/synapse/storage/relations.py +++ b/synapse/storage/relations.py @@ -54,7 +54,7 @@ class PaginationChunk(object): return d -@attr.s +@attr.s(frozen=True, slots=True) class RelationPaginationToken(object): """Pagination token for relation pagination API. @@ -85,7 +85,7 @@ class RelationPaginationToken(object): return attr.astuple(self) -@attr.s +@attr.s(frozen=True, slots=True) class AggregationPaginationToken(object): """Pagination token for relation aggregation pagination API. @@ -151,12 +151,6 @@ class RelationsWorkerStore(SQLBaseStore): requested. The rows are of the form `{"event_id": "..."}`. """ - if from_token: - from_token = RelationPaginationToken.from_string(from_token) - - if to_token: - to_token = RelationPaginationToken.from_string(to_token) - where_clause = ["relates_to_id = ?"] where_args = [event_id] @@ -258,12 +252,6 @@ class RelationsWorkerStore(SQLBaseStore): match. Each row is a dict with `type`, `key` and `count` fields. """ - if from_token: - from_token = AggregationPaginationToken.from_string(from_token) - - if to_token: - to_token = AggregationPaginationToken.from_string(to_token) - where_clause = ["relates_to_id = ?", "relation_type = ?"] where_args = [event_id, RelationTypes.ANNOTATION] |