api: Include `stream_id` field for all edits to stream messages.

Updates the `update_message` event type to always include a `stream_id`
field when the message being edited is a stream message. This change
aligns with the current definition of the `\get-events` endpoint
in the OpenAPI documentation.
This commit is contained in:
Lauryn Menard 2021-12-14 18:14:10 +01:00 committed by Tim Abbott
parent 1dc36c3f16
commit 3b72da8a7c
4 changed files with 12 additions and 2 deletions

View File

@ -20,6 +20,11 @@ format used by the Zulip server that they are interacting with.
## Changes in Zulip 5.0 ## Changes in Zulip 5.0
**Feature level 112**
* [`GET /events`](/api/get-events): Updated `update_message` event type
to include `stream_id` field for all edits to stream messages.
**Feature level 111** **Feature level 111**
* [`POST /subscriptions/properties`](/api/update-subscription-settings): * [`POST /subscriptions/properties`](/api/update-subscription-settings):

View File

@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.4.3"
# Changes should be accompanied by documentation explaining what the # Changes should be accompanied by documentation explaining what the
# new level means in templates/zerver/api/changelog.md, as well as # new level means in templates/zerver/api/changelog.md, as well as
# "**Changes**" entries in the endpoint's documentation in `zulip.yaml`. # "**Changes**" entries in the endpoint's documentation in `zulip.yaml`.
API_FEATURE_LEVEL = 111 API_FEATURE_LEVEL = 112
# Bump the minor PROVISION_VERSION to indicate that folks should provision # Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump # only when going from an old version of the code to a newer version. Bump

View File

@ -6287,6 +6287,7 @@ def do_update_message(
stream_id = target_message.recipient.type_id stream_id = target_message.recipient.type_id
stream_being_edited = get_stream_by_id_in_realm(stream_id, realm) stream_being_edited = get_stream_by_id_in_realm(stream_id, realm)
event["stream_name"] = stream_being_edited.name event["stream_name"] = stream_being_edited.name
event["stream_id"] = stream_being_edited.id
ums = UserMessage.objects.filter(message=target_message.id) ums = UserMessage.objects.filter(message=target_message.id)
@ -6380,7 +6381,6 @@ def do_update_message(
if topic_name is not None or new_stream is not None: if topic_name is not None or new_stream is not None:
orig_topic_name = target_message.topic_name() orig_topic_name = target_message.topic_name()
event["propagate_mode"] = propagate_mode event["propagate_mode"] = propagate_mode
event["stream_id"] = target_message.recipient.type_id
if new_stream is not None: if new_stream is not None:
assert content is None assert content is None

View File

@ -2030,6 +2030,11 @@ paths:
The pre-edit stream for all of the messages with IDs in The pre-edit stream for all of the messages with IDs in
`message_ids`. `message_ids`.
**Changes**: As of Zulip 5.0 (feature level 112), this field
is present for all edits to a stream message. Previously, it
was not present when only the content of the stream message was
edited.
new_stream_id: new_stream_id:
type: integer type: integer
description: | description: |