Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typing: Rename "(no topic)" to empty string topic.

Prakhar Pratyushd011fb062186
diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index 4e7c3aaacb2..1b808d637bd 100644
--- a/api_docs/changelog.md
+++ b/api_docs/changelog.md
@@ -25,6 +25,11 @@ releases.
## Changes in Zulip 10.0
+**Feature level 372**
+
+* [`POST /typing`](/api/set-typing-status): The `"(no topic)"` value
+ when used for `topic` parameter is now interpreted as an empty string.
+
**Feature level 371**
No changes; feature level used for Zulip 10.0 release.
diff --git a/version.py b/version.py
index 6135f0f9780..5995189543a 100644
--- a/version.py
+++ b/version.py
@@ -34,7 +34,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"
# new level means in api_docs/changelog.md, as well as "**Changes**"
# entries in the endpoint's documentation in `zulip.yaml`.
-API_FEATURE_LEVEL = 371 # Last bumped for Zulip 10.0 release.
+API_FEATURE_LEVEL = 372 # Last bumped to interpret "(no topic)" as empty string.
# 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
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 1522a01f165..4ea27e954f3 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -21419,11 +21419,14 @@ paths:
Topic to which message is being typed. Required for the `"stream"` or `"channel"`
type. Ignored in the case of `"direct"` type.
- Note: When the value of `realm_empty_topic_display_name` found in
- the [POST /register](/api/register-queue) response is used for this
+ Note: When `"(no topic)"` or the value of `realm_empty_topic_display_name`
+ found in the [POST /register](/api/register-queue) response is used for this
parameter, it is interpreted as an empty string.
- **Changes**: Before Zulip 10.0 (feature level 334), empty string
+ **Changes**: Before Zulip 10.0 (feature level 372),
+ `"(no topic)"` was not interpreted as an empty string.
+
+ Before Zulip 10.0 (feature level 334), empty string
was not a valid topic name for channel messages.
New in Zulip 4.0 (feature level 58). Previously, typing notifications
diff --git a/zerver/views/typing.py b/zerver/views/typing.py
index 0af11455e89..3e333442c73 100644
--- a/zerver/views/typing.py
+++ b/zerver/views/typing.py
@@ -15,7 +15,10 @@ from zerver.lib.exceptions import JsonableError
from zerver.lib.message import access_message
from zerver.lib.response import json_success
from zerver.lib.streams import access_stream_by_id_for_message, access_stream_for_send_message
-from zerver.lib.topic import maybe_rename_general_chat_to_empty_topic
+from zerver.lib.topic import (
+ maybe_rename_general_chat_to_empty_topic,
+ maybe_rename_no_topic_to_empty_topic,
+)
from zerver.lib.typed_endpoint import ApiParamConfig, OptionalTopic, PathOnly, typed_endpoint
from zerver.models import Recipient, UserProfile
from zerver.models.recipients import get_direct_message_group_user_ids
@@ -54,6 +57,7 @@ def send_notification_backend(
stream = access_stream_by_id_for_message(user_profile, stream_id)[0]
access_stream_for_send_message(user_profile, stream, forwarder_user_profile=None)
topic = maybe_rename_general_chat_to_empty_topic(topic)
+ topic = maybe_rename_no_topic_to_empty_topic(topic)
do_send_stream_typing_notification(user_profile, operator, stream, topic)
else:
if notification_to is None: