aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/api_spec
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-03 19:21:23 +0200
committerlain <lain@soykaf.club>2020-06-03 19:21:23 +0200
commitb3407344d3acafa4a1271289d985632c058e7a6e (patch)
tree0978d0e13ae38f295dabef8d3b336cc03e74c4d1 /lib/pleroma/web/api_spec
parentc020fd435216012f08812efdb9ee0c05352cec10 (diff)
downloadpleroma-b3407344d3acafa4a1271289d985632c058e7a6e.tar.gz
ChatController: Add function to mark single message as read.
Diffstat (limited to 'lib/pleroma/web/api_spec')
-rw-r--r--lib/pleroma/web/api_spec/operations/chat_operation.ex31
1 files changed, 29 insertions, 2 deletions
diff --git a/lib/pleroma/web/api_spec/operations/chat_operation.ex b/lib/pleroma/web/api_spec/operations/chat_operation.ex
index a1c5db5dc..6ad325113 100644
--- a/lib/pleroma/web/api_spec/operations/chat_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/chat_operation.ex
@@ -39,6 +39,31 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
}
end
+ def mark_message_as_read_operation do
+ %Operation{
+ tags: ["chat"],
+ summary: "Mark one message in the chat as read",
+ operationId: "ChatController.mark_message_as_read",
+ parameters: [
+ Operation.parameter(:id, :path, :string, "The ID of the Chat"),
+ Operation.parameter(:message_id, :path, :string, "The ID of the message")
+ ],
+ responses: %{
+ 200 =>
+ Operation.response(
+ "The read ChatMessage",
+ "application/json",
+ ChatMessage
+ )
+ },
+ security: [
+ %{
+ "oAuth" => ["write"]
+ }
+ ]
+ }
+ end
+
def show_operation do
%Operation{
tags: ["chat"],
@@ -274,7 +299,8 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
"content" => "Check this out :firefox:",
"id" => "13",
"chat_id" => "1",
- "actor_id" => "someflakeid"
+ "actor_id" => "someflakeid",
+ "unread" => false
},
%{
"actor_id" => "someflakeid",
@@ -282,7 +308,8 @@ defmodule Pleroma.Web.ApiSpec.ChatOperation do
"id" => "12",
"chat_id" => "1",
"emojis" => [],
- "created_at" => "2020-04-21T15:06:45.000Z"
+ "created_at" => "2020-04-21T15:06:45.000Z",
+ "unread" => false
}
]
}