diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2020-01-30 11:25:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 11:25:59 +0000 |
commit | 5a246611e3cbf27cf1dd7e4453adc8040cddd6a2 (patch) | |
tree | 549d4432af55704c2c59d687fb4c0eef0ca4c207 /synapse/events | |
parent | Remove unused DeviceRow class (#6800) (diff) | |
download | synapse-5a246611e3cbf27cf1dd7e4453adc8040cddd6a2.tar.xz |
Type defintions for use in refactoring for redaction changes (#6803)
* Bump signedjson to 1.1 ... so that we can use the type definitions * Fix breakage caused by upgrade to signedjson 1.1 Thanks, @illicitonion...
Diffstat (limited to 'synapse/events')
-rw-r--r-- | synapse/events/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py index 72c09327f4..f813fa2fe7 100644 --- a/synapse/events/__init__.py +++ b/synapse/events/__init__.py @@ -23,6 +23,7 @@ from unpaddedbase64 import encode_base64 from synapse.api.errors import UnsupportedRoomVersionError from synapse.api.room_versions import KNOWN_ROOM_VERSIONS, EventFormatVersions +from synapse.types import JsonDict from synapse.util.caches import intern_dict from synapse.util.frozenutils import freeze @@ -197,7 +198,7 @@ class EventBase(object): def is_state(self): return hasattr(self, "state_key") and self.state_key is not None - def get_dict(self): + def get_dict(self) -> JsonDict: d = dict(self._event_dict) d.update({"signatures": self.signatures, "unsigned": dict(self.unsigned)}) @@ -209,7 +210,7 @@ class EventBase(object): def get_internal_metadata_dict(self): return self.internal_metadata.get_dict() - def get_pdu_json(self, time_now=None): + def get_pdu_json(self, time_now=None) -> JsonDict: pdu_json = self.get_dict() if time_now is not None and "age_ts" in pdu_json["unsigned"]: |