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_indicator: Replace private with direct in 'message_type' field.

Prakhar Pratyusha22f63776981
diff --git a/api_docs/changelog.md b/api_docs/changelog.md
index 501f836936c..ba6cbfc80ea 100644
--- a/api_docs/changelog.md
+++ b/api_docs/changelog.md
@@ -20,6 +20,12 @@ format used by the Zulip server that they are interacting with.
## Changes in Zulip 8.0
+**Feature level 215**
+
+* [`GET /events`](/api/get-events): Replaced the value `private`
+ with `direct` in the `message_type` field for the `typing` events
+ sent when a user starts or stops typing a message.
+
**Feature level 214**
* [`PATCH /realm/user_settings_defaults`](/api/update-realm-user-settings-defaults),
diff --git a/version.py b/version.py
index d737c9036b7..b86e1316fb8 100644
--- a/version.py
+++ b/version.py
@@ -33,7 +33,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"
# Changes should be accompanied by documentation explaining what the
# new level means in api_docs/changelog.md, as well as "**Changes**"
# entries in the endpoint's documentation in `zulip.yaml`.
-API_FEATURE_LEVEL = 214
+API_FEATURE_LEVEL = 215
# 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/web/tests/lib/events.js b/web/tests/lib/events.js
index ee7754e712f..fa27815d219 100644
--- a/web/tests/lib/events.js
+++ b/web/tests/lib/events.js
@@ -756,7 +756,7 @@ exports.fixtures = {
typing__start: {
type: "typing",
op: "start",
- message_type: "private",
+ message_type: "direct",
sender: typing_person1,
recipients: [typing_person2],
},
@@ -764,7 +764,7 @@ exports.fixtures = {
typing__stop: {
type: "typing",
op: "stop",
- message_type: "private",
+ message_type: "direct",
sender: typing_person1,
recipients: [typing_person2],
},
diff --git a/zerver/actions/typing.py b/zerver/actions/typing.py
index f18ddf020b7..adac26f14e1 100644
--- a/zerver/actions/typing.py
+++ b/zerver/actions/typing.py
@@ -19,7 +19,7 @@ def do_send_typing_notification(
]
event = dict(
type="typing",
- message_type="private",
+ message_type="direct",
op=operator,
sender=sender_dict,
recipients=recipient_dicts,
diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py
index aab4e396f71..4d70a1dd804 100644
--- a/zerver/lib/event_schema.py
+++ b/zerver/lib/event_schema.py
@@ -1443,9 +1443,9 @@ typing_person_type = DictType(
]
)
-equals_private_or_stream = EnumType(
+equals_direct_or_stream = EnumType(
[
- "private",
+ "direct",
"stream",
]
)
@@ -1454,7 +1454,7 @@ typing_start_event = event_dict_type(
required_keys=[
("type", Equals("typing")),
("op", Equals("start")),
- ("message_type", equals_private_or_stream),
+ ("message_type", equals_direct_or_stream),
("sender", typing_person_type),
],
optional_keys=[
@@ -1469,7 +1469,7 @@ typing_stop_event = event_dict_type(
required_keys=[
("type", Equals("typing")),
("op", Equals("stop")),
- ("message_type", equals_private_or_stream),
+ ("message_type", equals_direct_or_stream),
("sender", typing_person_type),
],
optional_keys=[
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index d2f247a410c..d810ce7b03f 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -2523,12 +2523,15 @@ paths:
message_type:
type: string
description: |
- Type of message being composed. Must be `"stream"` or `"private"`.
+ Type of message being composed. Must be `"stream"` or `"direct"`.
- **Changes**: New in Zulip 4.0 (feature level 58). Previously,
- all typing notifications were implicitly direct messages.
+ **Changes**: In Zulip 8.0 (feature level 215), replaced the
+ value `"private"` with `"direct"`.
+
+ New in Zulip 4.0 (feature level 58). Previously, all typing
+ notifications were implicitly direct messages.
enum:
- - private
+ - direct
- stream
sender:
additionalProperties: false
@@ -2547,7 +2550,7 @@ paths:
recipients:
type: array
description: |
- Only present if `message_type` is `"private"`.
+ Only present if `message_type` is `"direct"`.
Array of dictionaries describing the set of users who would be
recipients of the message being typed. Each dictionary contains
@@ -2589,7 +2592,7 @@ paths:
{
"type": "typing",
"op": "start",
- "message_type": "private",
+ "message_type": "direct",
"sender":
{
"user_id": 10,
@@ -2641,12 +2644,15 @@ paths:
message_type:
type: string
description: |
- Type of message being composed. Must be `"stream"` or `"private"`.
+ Type of message being composed. Must be `"stream"` or `"direct"`.
- **Changes**: New in Zulip 4.0 (feature level 58). Previously,
- all typing notifications were implicitly direct messages.
+ **Changes**: In Zulip 8.0 (feature level 215), replaced the
+ value `"private"` with `"direct"`.
+
+ New in Zulip 4.0 (feature level 58). Previously all typing
+ notifications were implicitly direct messages.
enum:
- - private
+ - direct
- stream
sender:
additionalProperties: false
@@ -2665,7 +2671,7 @@ paths:
recipients:
type: array
description: |
- Only present if `message_type` is `"private"`.
+ Only present if `message_type` is `"direct"`.
Array of dictionaries describing the set of users who would be
recipients of the message that was previously being typed. Each
@@ -2707,7 +2713,7 @@ paths:
{
"type": "typing",
"op": "stop",
- "message_type": "private",
+ "message_type": "direct",
"sender":
{
"user_id": 10,
diff --git a/zerver/views/typing.py b/zerver/views/typing.py
index bc1ca7912f2..87d0bf1f52b 100644
--- a/zerver/views/typing.py
+++ b/zerver/views/typing.py
@@ -32,7 +32,6 @@ def send_notification_backend(
recipient_type_name = req_type
if recipient_type_name == "private":
- # TODO: Use "direct" in typing notification events.
recipient_type_name = "direct"
if recipient_type_name == "stream":