summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-12-12 15:18:49 +0100
committerJoas Schilling <coding@schilljs.com>2024-01-10 13:08:01 +0100
commit7d3db3ab16e0345e95fe32473ce671df67c09f5a (patch)
tree5b155e6cd0936cd349aa64539b2a53dbcd8d8517 /lib
parent29f0d44641a3d3cdcb28319835fe7d9c3717fc2d (diff)
feat(chat): API specs for "Edit message"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/ChatController.php24
-rw-r--r--lib/ResponseDefinitions.php4
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index ab68e5e84..bd23f064b 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -677,7 +677,7 @@ class ChatController extends AEnvironmentAwareController {
* 400: Deleting message is not possible
* 403: Missing permissions to delete message
* 404: Message not found
- * 405: Deleting message is not allowed
+ * 405: Deleting this message type is not allowed
*/
#[NoAdminRequired]
#[RequireModeratorOrNoLobby]
@@ -748,6 +748,28 @@ class ChatController extends AEnvironmentAwareController {
}
/**
+ * Edit a chat message
+ *
+ * @param int $messageId ID of the message
+ * @psalm-param non-negative-int $messageId
+ * @return DataResponse<Http::STATUS_OK|Http::STATUS_ACCEPTED, TalkChatMessageWithParent, array{X-Chat-Last-Common-Read?: numeric-string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND|Http::STATUS_METHOD_NOT_ALLOWED, array<empty>, array{}>
+ *
+ * 200: Message edited successfully
+ * 202: Message edited successfully, but Matterbridge is configured, so the information can be replicated elsewhere
+ * 400: Editing message is not possible
+ * 403: Missing permissions to edit message
+ * 404: Message not found
+ * 405: Editing this message type is not allowed
+ */
+ #[NoAdminRequired]
+ #[RequireModeratorOrNoLobby]
+ #[RequireParticipant]
+ #[RequirePermission(permission: RequirePermission::CHAT)]
+ #[RequireReadWriteConversation]
+ public function editMessage(int $messageId): DataResponse {
+ }
+
+ /**
* Set a reminder for a chat message
*
* @param int $messageId ID of the message
diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php
index 12efb2d1e..729a98d47 100644
--- a/lib/ResponseDefinitions.php
+++ b/lib/ResponseDefinitions.php
@@ -83,6 +83,10 @@ namespace OCA\Talk;
* systemMessage: string,
* timestamp: int,
* token: string,
+ * lastEditActorDisplayName?: string,
+ * lastEditActorId?: string,
+ * lastEditActorType?: string,
+ * lastEditTimestamp?: int,
* }
*
* @psalm-type TalkChatMessageWithParent = TalkChatMessage&array{parent?: TalkChatMessage}