mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-09 20:22:12 -04:00
Add helper to parse an enum from query args & use it. (#14956)
The `parse_enum` helper pulls an enum value from the query string (by delegating down to the parse_string helper with values generated from the enum). This is used to pull out "f" and "b" in most places and then we thread the resulting Direction enum throughout more code.
This commit is contained in:
parent
230a831c73
commit
1182ae5063
25 changed files with 176 additions and 96 deletions
|
@ -314,7 +314,7 @@ class AccountDataEventSource(EventSource[int, JsonDict]):
|
|||
def __init__(self, hs: "HomeServer"):
|
||||
self.store = hs.get_datastores().main
|
||||
|
||||
def get_current_key(self, direction: str = "f") -> int:
|
||||
def get_current_key(self) -> int:
|
||||
return self.store.get_max_account_data_stream_id()
|
||||
|
||||
async def get_new_events(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue