mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
types: Add EditHistoryEvent and APIEditHistoryEvent types.
These types will help make iteration on this code easier. Note that `user_id` can be null due to the fact that edit history entries before March 2017 did not log the user that made the edit, which was years after supporting topic edits (discovered in test deployment of migration on chat.zulip.org). Co-authored-by: Lauryn Menard <lauryn.menard@gmail.com>
This commit is contained in:
@@ -89,3 +89,40 @@ class UnspecifiedValue:
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class APIEditHistoryEvent(TypedDict, total=False):
|
||||
"""Format of legacy edit history events in the API. Contains legacy
|
||||
fields like LEGACY_PREV_TOPIC that we intend to remove from the
|
||||
API eventually.
|
||||
"""
|
||||
|
||||
# Commented fields are fields we plan to add.
|
||||
user_id: Optional[int]
|
||||
timestamp: int
|
||||
prev_stream: int
|
||||
# stream: int
|
||||
prev_subject: str
|
||||
# prev_topic: str
|
||||
# topic: str
|
||||
prev_content: str
|
||||
prev_rendered_content: Optional[str]
|
||||
prev_rendered_content_version: Optional[int]
|
||||
|
||||
|
||||
class EditHistoryEvent(TypedDict, total=False):
|
||||
"""
|
||||
Database format for edit history events.
|
||||
"""
|
||||
|
||||
# Commented fields are fields we plan to add.
|
||||
user_id: Optional[int]
|
||||
timestamp: int
|
||||
prev_stream: int
|
||||
# stream: int
|
||||
prev_subject: str
|
||||
# prev_topic: str
|
||||
# topic: str
|
||||
prev_content: str
|
||||
prev_rendered_content: Optional[str]
|
||||
prev_rendered_content_version: Optional[int]
|
||||
|
||||
Reference in New Issue
Block a user