mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-15 16:00:11 -04:00
Return the stable event
field from /send_join
per MSC3083. (#11413)
This does not remove the unstable field and still parses both. Handling of the unstable field will need to be removed in the future.
This commit is contained in:
parent
7564b8e118
commit
9d1971a5c4
5 changed files with 19 additions and 4 deletions
|
@ -1317,15 +1317,26 @@ class SendJoinParser(ByteParser[SendJoinResponse]):
|
|||
prefix + "auth_chain.item",
|
||||
use_float=True,
|
||||
)
|
||||
self._coro_event = ijson.kvitems_coro(
|
||||
# TODO Remove the unstable prefix when servers have updated.
|
||||
#
|
||||
# By re-using the same event dictionary this will cause the parsing of
|
||||
# org.matrix.msc3083.v2.event and event to stomp over each other.
|
||||
# Generally this should be fine.
|
||||
self._coro_unstable_event = ijson.kvitems_coro(
|
||||
_event_parser(self._response.event_dict),
|
||||
prefix + "org.matrix.msc3083.v2.event",
|
||||
use_float=True,
|
||||
)
|
||||
self._coro_event = ijson.kvitems_coro(
|
||||
_event_parser(self._response.event_dict),
|
||||
prefix + "event",
|
||||
use_float=True,
|
||||
)
|
||||
|
||||
def write(self, data: bytes) -> int:
|
||||
self._coro_state.send(data)
|
||||
self._coro_auth.send(data)
|
||||
self._coro_unstable_event.send(data)
|
||||
self._coro_event.send(data)
|
||||
|
||||
return len(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue