diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py index 7cfd53dea0..997c2b5057 100644 --- a/zerver/lib/actions.py +++ b/zerver/lib/actions.py @@ -2689,9 +2689,14 @@ def do_update_embedded_data(user_profile, message, content, rendered_content): def do_update_message(user_profile, message, subject, propagate_mode, content, rendered_content): # type: (UserProfile, Message, Optional[Text], str, Optional[Text], Optional[Text]) -> int event = {'type': 'update_message', + # TODO: We probably want to remove the 'sender' field + # after confirming it isn't used by any consumers. 'sender': user_profile.email, + 'user_id': user_profile.id, 'message_id': message.id} # type: Dict[str, Any] - edit_history_event = {} # type: Dict[str, Any] + edit_history_event = { + 'user_id': user_profile.id, + } # type: Dict[str, Any] changed_messages = [message] # Set first_rendered_content to be the oldest version of the diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py index 4366880532..cc44fe566f 100644 --- a/zerver/tests/test_events.py +++ b/zerver/tests/test_events.py @@ -367,6 +367,7 @@ class EventsRegisterTest(ZulipTestCase): ('stream_id', check_int), ('subject', check_string), ('subject_links', check_list(None)), + ('user_id', check_int), # There is also a timestamp field in the event, but we ignore it, as # it's kind of an unwanted but harmless side effect of calling log_event. ])