Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

event_schema: Fix translation of typing events message_type.

Tim Abbott1afc0496caef
diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py
index b1ccc829719..d9eb8ea6e45 100644
--- a/zerver/lib/event_schema.py
+++ b/zerver/lib/event_schema.py
@@ -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=[