message_send: Add support to send message with an empty topic name.

This commit is a part of the work to support empty string
as a topic name.

Previously, empty string was not a valid topic name.

Adds a `empty_topic_name` client capability to allow client
to specify whether it supports empty string as a topic name.

Adds backward compatibility for:
- `subject` field in the `message` event type
This commit is contained in:
Prakhar Pratyush
2024-11-12 19:16:51 +05:30
committed by Tim Abbott
parent 9f1dc08ff2
commit 3ba198e79a
18 changed files with 165 additions and 26 deletions

View File

@@ -214,6 +214,10 @@ def get_events_backend(
Json[bool],
ApiParamConfig(documentation_status=DocumentationStatus.INTENTIONALLY_UNDOCUMENTED),
] = False,
empty_topic_name: Annotated[
Json[bool],
ApiParamConfig(documentation_status=DocumentationStatus.INTENTIONALLY_UNDOCUMENTED),
] = False,
) -> HttpResponse:
if narrow is None:
narrow = []
@@ -254,6 +258,7 @@ def get_events_backend(
user_list_incomplete=user_list_incomplete,
include_deactivated_groups=include_deactivated_groups,
archived_channels=archived_channels,
empty_topic_name=empty_topic_name,
)
result = in_tornado_thread(fetch_events)(