api-docs: Update the add and remove update_message_flags events.

Clarifies that the `all` field in the `op: "add"` event is only
relevant for the `"read"` message flag, and that it will be false
for all other specified flags in theses events.

Deprecates the `all` field in the `op: "remove"` event and document
that it is false for all specified flags.

Updates the deprecated `operation` field description and makes
a few other small revisions to the event text for clarity and
accuracy.
This commit is contained in:
Lauryn Menard
2023-09-19 13:22:20 +02:00
committed by Tim Abbott
parent 4fb5dee5a4
commit 48a1cf04d0
2 changed files with 24 additions and 34 deletions

View File

@@ -1630,7 +1630,7 @@ update_message_flags_remove_event = event_dict_type(
("type", Equals("update_message_flags")), ("type", Equals("update_message_flags")),
("op", Equals("remove")), ("op", Equals("remove")),
("operation", Equals("remove")), ("operation", Equals("remove")),
("flag", EnumType(["read", "starred"])), ("flag", str),
("messages", ListType(int)), ("messages", ListType(int)),
("all", bool), ("all", bool),
], ],

View File

@@ -2726,7 +2726,7 @@ paths:
additionalProperties: false additionalProperties: false
description: | description: |
Event sent to a user when [message flags][message-flags] are added Event sent to a user when [message flags][message-flags] are added
to a message. to messages.
[message-flags]: /api/update-message-flags#available-flags [message-flags]: /api/update-message-flags#available-flags
properties: properties:
@@ -2744,17 +2744,17 @@ paths:
operation: operation:
deprecated: true deprecated: true
description: | description: |
Old name for `op` for this event type. Old name for the `op` field in this event type.
**Deprecated**: This is deprecated; please use `op` instead **Deprecated** in Zulip 4.0 (feature level 32), and
starting with Zulip 4.0 (feature level 32). replaced by the `op` field.
type: string type: string
enum: enum:
- add - add
flag: flag:
type: string type: string
description: | description: |
The flag that was added. The [flag][message-flags] that was added.
messages: messages:
type: array type: array
description: | description: |
@@ -2765,9 +2765,12 @@ paths:
all: all:
type: boolean type: boolean
description: | description: |
Whether the flag was added to all messages (E.g. all messages Whether the specified flag was added to all messages.
were marked as read). This field is only relevant for the `"read"` flag, and
If this is true, then the `messages` array will be empty. will be `false` for all other flags.
When `true` for the `"read"` flag, then the `messages`
array will be empty.
example: example:
{ {
"type": "update_message_flags", "type": "update_message_flags",
@@ -2782,19 +2785,9 @@ paths:
additionalProperties: false additionalProperties: false
description: | description: |
Event sent to a user when [message flags][message-flags] are Event sent to a user when [message flags][message-flags] are
removed from a message. removed from messages.
[message-flags]: /api/update-message-flags#available-flags [message-flags]: /api/update-message-flags#available-flags
required:
[
"id",
"type",
"op",
"operation",
"flag",
"messages",
"all",
]
properties: properties:
id: id:
$ref: "#/components/schemas/EventIdSchema" $ref: "#/components/schemas/EventIdSchema"
@@ -2811,19 +2804,16 @@ paths:
deprecated: true deprecated: true
type: string type: string
description: | description: |
Old name for `op` for this event type. Old name for the `op` field in this event type.
**Deprecated**: This is deprecated; please use `op` instead **Deprecated** in Zulip 4.0 (feature level 32), and
starting with Zulip 4.0 (feature level 32). replaced by the `op` field.
enum: enum:
- remove - remove
flag: flag:
type: string type: string
description: | description: |
The flag to be removed. The [flag][message-flags] to be removed.
enum:
- starred
- read
messages: messages:
type: array type: array
description: | description: |
@@ -2832,18 +2822,19 @@ paths:
items: items:
type: integer type: integer
all: all:
deprecated: true
type: boolean type: boolean
description: | description: |
Whether the flag was removed from all messages. Will be `false` for all specified flags.
If this is true then the `messages` array will be empty.
**Deprecated** and will be removed in a future release.
message_details: message_details:
description: | description: |
Present if `message` and `update_message_flags` are both present in Only present if the specified `flag` is `"read"`.
`event_types` and the `flag` is `read` and the `op` is `remove`.
A set of data structures describing the messages that A set of data structures describing the messages that
are being marked as unread with additional details to are being marked as unread with additional details to
allow a client to update the `unread_msgs` data allow clients to update the `unread_msgs` data
structure for these messages (which may not be structure for these messages (which may not be
otherwise known to the client). otherwise known to the client).
@@ -2898,8 +2889,7 @@ paths:
type: boolean type: boolean
deprecated: true deprecated: true
description: | description: |
**Deprecated** **Deprecated** internal implementation detail. Clients should
Internal implementation detail. Clients should
ignore this field as it will be removed in the future. ignore this field as it will be removed in the future.
example: example:
{ {