From c4a0f78e478fdca0353d3c47a6fcaaa0a0b30711 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 27 Jul 2023 18:25:41 +0200 Subject: [PATCH] feat(chat): Add a property to indicate whether markdown should be rendered Signed-off-by: Joas Schilling --- docs/chat.md | 1 + lib/Model/Message.php | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/chat.md b/docs/chat.md index 835f96ae6bf..7e777711513 100644 --- a/docs/chat.md +++ b/docs/chat.md @@ -61,6 +61,7 @@ Base endpoint is: `/ocs/v2.php/apps/spreed/api/v1`: since Nextcloud 13 | `parent` | array | **Optional:** See `Parent data` below | | `reactions` | int[] | **Optional:** An array map with relation between reaction emoji and total count of reactions with this emoji | | `reactionsSelf` | string[] | **Optional:** When the user reacted this is the list of emojis the user reacted with | +| `markdown` | bool | **Optional:** Whether the message should be rendered as markdown or shown as plain text | #### Parent data diff --git a/lib/Model/Message.php b/lib/Model/Message.php index 3ef4d6a8204..0be5935dde1 100644 --- a/lib/Model/Message.php +++ b/lib/Model/Message.php @@ -181,6 +181,7 @@ public function toArray(string $format): array { 'referenceId' => (string) $this->getComment()->getReferenceId(), 'reactions' => $reactions, 'expirationTimestamp' => $expireDate ? $expireDate->getTimestamp() : 0, + 'markdown' => $this->getMessageType() === ChatManager::VERB_SYSTEM ? false : true, ]; if ($this->getMessageType() === ChatManager::VERB_MESSAGE_DELETED) {