tornado: Add transitional code for sender_delivery_email.

This issue was introduced in 54e357e154.
This commit is contained in:
Tim Abbott 2019-11-20 17:31:11 -08:00
parent a681ca6cf5
commit f0fd812cc5
1 changed files with 10 additions and 0 deletions

View File

@ -821,6 +821,16 @@ def process_message_event(event_template: Mapping[str, Any], users: Iterable[Map
@cachify
def get_client_payload(apply_markdown: bool, client_gravatar: bool) -> Dict[str, Any]:
dct = copy.deepcopy(wide_dict)
# Temporary transitional code: Zulip servers that have message
# events in their event queues and upgrade to the new version
# that expects sender_delivery_email in these events will
# throw errors processing events. We can remove this block
# once we don't expect anyone to be directly upgrading from
# 2.0.x to the latest Zulip.
if 'sender_delivery_email' not in dct: # nocoverage
dct['sender_delivery_email'] = dct['sender_email']
MessageDict.finalize_payload(dct, apply_markdown, client_gravatar)
return dct