Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-19 14:50:45 +0300
committerJoas Schilling <coding@schilljs.com>2021-02-02 15:52:25 +0300
commit47c76fa9eb6d57770b69d07e4a7a6215e3fe4436 (patch)
treecbcdf160ac1c0e0ed2051fdf4339b81804d9f066 /docs
parent5db677377a6f525ed9ad6db46b705f6e40df8d12 (diff)
Add docs and restrict deleting to non-lobby and read-write chats
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/chat.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/docs/chat.md b/docs/chat.md
index 78a2840aa..da98470b6 100644
--- a/docs/chat.md
+++ b/docs/chat.md
@@ -96,6 +96,34 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1`
- Data:
The full message array of the new message, as defined in [Receive chat messages of a conversation](#receive-chat-messages-of-a-conversation)
+
+## Deleting a chat message
+
+* Method: `DELETE`
+* Endpoint: `/chat/{token}/{messageId}`
+
+* Response:
+ - Status code:
+ + `200 OK` - When deleting was successful
+ + `202 Accepted` - When deleting was successful but Matterbridge is enabled so the message was leaked to other services
+ + `400 Bad Request` The message is already older than 6 hours
+ + `403 Forbidden` When the message is not from the current user and the user not a moderator
+ + `403 Forbidden` When the conversation is read-only
+ + `404 Not Found` When the conversation or chat message could not be found for the participant
+ + `412 Precondition Failed` When the lobby is active and the user is not a moderator
+
+ - Header:
+
+ field | type | Description
+ ------|------|------------
+ `X-Chat-Last-Common-Read` | int | ID of the last message read by every user that has read privacy set to public. When the user themself has it set to private the value the header is not set (only available with `chat-read-status` capability)
+
+ - Data:
+ The full message array of the new system message "You deleted a message", as defined in [Receive chat messages of a conversation](#receive-chat-messages-of-a-conversation)
+ The parent message is the object of the deleted message with the replaced text "Message deleted by you".
+ This message should not be displayed to the user but instead be used to remove the original message from any cache/storage of the device.
+
+
## Mark chat as read
* Method: `POST`
@@ -119,7 +147,6 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1`
`X-Chat-Last-Common-Read` | int | ID of the last message read by every user that has read privacy set to public. When the user themself has it set to private the value the header is not set (only available with `chat-read-status` capability)
-
## Get mention autocomplete suggestions
* Method: `GET`