Skip to content

Commit

Permalink
Merge pull request #10067 from nextcloud/feat/9950/add-markdown-property
Browse files Browse the repository at this point in the history
feat(chat): Add a property to indicate whether markdown should be ren…
  • Loading branch information
Antreesy authored Jul 27, 2023
2 parents 3aff970 + c4a0f78 commit 53ae33b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/chat.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions lib/Model/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 53ae33b

Please sign in to comment.