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.

docs: Document local echo paramters for sending messages.

Tim Abbottdef6189d5341
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 165db06120a..45f187cdca3 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -722,8 +722,33 @@ paths:
type: integer
example: [9, 10]
required: true
- - $ref: '#/components/parameters/Topic'
- $ref: '#/components/parameters/Content'
+ - $ref: '#/components/parameters/Topic'
+ - name: queue_id
+ in: query
+ schema:
+ type: string
+ description: |
+ For clients supporting
+ [local echo](https://zulip.readthedocs.io/en/latest/subsystems/sending-messages.html#local-echo),
+ the [event queue](/api/register-queue)
+ ID for the client. If passed, `local_id` is required. If the message is
+ successfully sent, the server will include `local_id` in the `message` event
+ that the client with this `queue_id` will receive notifying it of the new message
+ via [`GET /events`](/api/get-events). This lets the client know unambiguously
+ that it should replace the locally echoed message, rather than adding this new
+ message (which would be correct if the user had sent the new message from another
+ device).
+ example: "1593114627:0"
+ - name: local_id
+ in: query
+ schema:
+ type: string
+ description: |
+ For clients supporting local echo, a unique string-format identifier
+ chosen freely by the client; the server will pass it back to the client without
+ inspecting it, as described in the `queue_id` description.
+ example: "100.01"
responses:
'200':
description: Success.
diff --git a/zerver/views/message_send.py b/zerver/views/message_send.py
index 065c459bf12..8c51148066a 100644
--- a/zerver/views/message_send.py
+++ b/zerver/views/message_send.py
@@ -169,10 +169,8 @@ def send_message_backend(request: HttpRequest, user_profile: UserProfile,
documentation_pending=True),
realm_str: Optional[str]=REQ('realm_str', default=None,
documentation_pending=True),
- local_id: Optional[str]=REQ(default=None,
- documentation_pending=True),
- queue_id: Optional[str]=REQ(default=None,
- documentation_pending=True),
+ local_id: Optional[str]=REQ(default=None),
+ queue_id: Optional[str]=REQ(default=None),
delivery_type: str=REQ('delivery_type', default='send_now',
documentation_pending=True),
defer_until: Optional[str]=REQ('deliver_at', default=None,