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.

openapi: Document `color` parameter for POST /users/me/subscriptions.

Agnish Bauri142a4300f368
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 6d9de10cc52..444c8979bb4 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -13163,11 +13163,12 @@ paths:
properties:
subscriptions:
description: |
- A list of dictionaries containing the key `name` and value
- specifying the name of the channel to subscribe. If the channel does not
- exist a new channel is created. The description of the channel created can
- be specified by setting the dictionary key `description` with an
- appropriate value.
+ A list of dictionaries containing information about the
+ channels that users will be subscribed to.
+
+ For each channel, there must be a key `name` and value
+ specifying the name of the channel. If a channel with that
+ name does not exist, then a new channel is created.
type: array
items:
type: object
@@ -13192,6 +13193,26 @@ paths:
Clients should use the `max_stream_description_length` returned
by the [`POST /register`](/api/register-queue) endpoint to
determine the maximum channel description length.
+ color:
+ type: string
+ description: |
+ The hex value of the user's display color for the channel.
+ The server will return an error if the value is not a valid
+ hex color code.
+
+ This color is only applied to subscriptions that are newly
+ created by this request. Users who are already subscribed to
+ the channel, or who were subscribed to it in the past, keep
+ their existing display color. If this key is omitted, the
+ server assigns each new subscriber a display color, preferring
+ one that they are not already using for another channel.
+
+ Some clients compute a placeholder color when displaying the
+ current user's unsubscribed channels so that they don't all
+ show up in a list with the same color. If a client does this,
+ then it should pass the placeholder color here so that the
+ channel's color doesn't change when the current user is
+ subscribed.
required:
- name
example:
@@ -13199,6 +13220,8 @@ paths:
value: {"name": "Verona"}
with-description:
value: {"name": "Verona", "description": "Italian city"}
+ with-color:
+ value: {"name": "Verona", "color": "#e79ab5"}
example: [{"name": "Verona", "description": "Italian city"}]
principals:
$ref: "#/components/schemas/Principals"