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/lib/Model
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-01-15 11:45:21 +0300
committerJoas Schilling <coding@schilljs.com>2021-02-02 15:52:24 +0300
commit9608867be3d01a9aa34aceb1a1ba454fc2e0f8b6 (patch)
treec66bdbf3595d78fb12a4fad7a657e1dbc5d60096 /lib/Model
parent3d273aa6e8e18d4b096e74221eaf52b30b49e366 (diff)
Post a system message when deleting a message
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Model')
-rw-r--r--lib/Model/Message.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Model/Message.php b/lib/Model/Message.php
index 97d578c18..97e63e8de 100644
--- a/lib/Model/Message.php
+++ b/lib/Model/Message.php
@@ -162,7 +162,7 @@ class Message {
}
public function toArray(): array {
- return [
+ $data = [
'id' => (int) $this->getComment()->getId(),
'token' => $this->getRoom()->getToken(),
'actorType' => $this->getActorType(),
@@ -176,5 +176,11 @@ class Message {
'isReplyable' => $this->isReplyable(),
'referenceId' => (string) $this->getComment()->getReferenceId(),
];
+
+ if ($this->getMessageType() === 'comment_deleted') {
+ $data['deleted'] = true;
+ }
+
+ return $data;
}
}