delete_topic: Add support for empty topic name.

This commit is contained in:
Prakhar Pratyush 2024-11-15 16:26:18 +05:30
parent a1c3920df3
commit 8328c9fdb0
1 changed files with 2 additions and 0 deletions

View File

@ -70,6 +70,7 @@ from zerver.lib.subscription_info import gather_subscriptions
from zerver.lib.topic import ( from zerver.lib.topic import (
get_topic_history_for_public_stream, get_topic_history_for_public_stream,
get_topic_history_for_stream, get_topic_history_for_stream,
maybe_rename_general_chat_to_empty_topic,
messages_for_topic, messages_for_topic,
) )
from zerver.lib.typed_endpoint import ApiParamConfig, PathOnly, typed_endpoint from zerver.lib.typed_endpoint import ApiParamConfig, PathOnly, typed_endpoint
@ -926,6 +927,7 @@ def delete_in_topic(
topic_name: str, topic_name: str,
) -> HttpResponse: ) -> HttpResponse:
stream, ignored_sub = access_stream_by_id(user_profile, stream_id) stream, ignored_sub = access_stream_by_id(user_profile, stream_id)
topic_name = maybe_rename_general_chat_to_empty_topic(topic_name)
messages = messages_for_topic( messages = messages_for_topic(
user_profile.realm_id, assert_is_not_none(stream.recipient_id), topic_name user_profile.realm_id, assert_is_not_none(stream.recipient_id), topic_name