mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-05 04:18:59 -04:00
Add type hints to various handlers. (#9223)
With this change all handlers except the e2e_* ones have type hints enabled.
This commit is contained in:
parent
26837d5dbe
commit
1baab20352
14 changed files with 205 additions and 138 deletions
|
@ -14,15 +14,25 @@
|
|||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.app.homeserver import HomeServer
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class StateDeltasHandler:
|
||||
def __init__(self, hs):
|
||||
def __init__(self, hs: "HomeServer"):
|
||||
self.store = hs.get_datastore()
|
||||
|
||||
async def _get_key_change(self, prev_event_id, event_id, key_name, public_value):
|
||||
async def _get_key_change(
|
||||
self,
|
||||
prev_event_id: Optional[str],
|
||||
event_id: Optional[str],
|
||||
key_name: str,
|
||||
public_value: str,
|
||||
) -> Optional[bool]:
|
||||
"""Given two events check if the `key_name` field in content changed
|
||||
from not matching `public_value` to doing so.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue