event_schema: Fix translation of typing events message_type.

This was incorrectly/lazily marked as a string, not as an enum of two
string values, in the previous commit.
This commit is contained in:
Tim Abbott 2021-04-27 21:34:40 -07:00
parent 27e4f5da92
commit 1afc0496ca
1 changed files with 9 additions and 2 deletions

View File

@ -1315,11 +1315,18 @@ typing_person_type = DictType(
]
)
equals_private_or_stream = EnumType(
[
"private",
"stream",
]
)
typing_start_event = event_dict_type(
required_keys=[
("type", Equals("typing")),
("op", Equals("start")),
("message_type", str),
("message_type", equals_private_or_stream),
("sender", typing_person_type),
],
optional_keys=[
@ -1334,7 +1341,7 @@ typing_stop_event = event_dict_type(
required_keys=[
("type", Equals("typing")),
("op", Equals("stop")),
("message_type", str),
("message_type", equals_private_or_stream),
("sender", typing_person_type),
],
optional_keys=[