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
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-25 23:33:17 +0300
committerJoas Schilling <coding@schilljs.com>2019-07-30 10:33:41 +0300
commitb14e63db1846a8c0a8b917850e02422681c73d9c (patch)
treeb08d9f45a422721a66544d2e36f272bc66e17dfc /lib/Controller
parent573f07eaf244fbb009afdaf798ca27f013ac9a9f (diff)
Prevent replying to commands and system messages
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r--lib/Controller/ChatController.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Controller/ChatController.php b/lib/Controller/ChatController.php
index c06d41c6c..974b9aefb 100644
--- a/lib/Controller/ChatController.php
+++ b/lib/Controller/ChatController.php
@@ -157,6 +157,12 @@ class ChatController extends AEnvironmentAwareController {
// Someone is trying to reply cross-rooms or to a non-existing message
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
+
+ $parentMessage = $this->messageParser->createMessage($this->room, $this->participant, $parent, $this->l);
+ $this->messageParser->parseMessage($parentMessage);
+ if ($parentMessage->getMessageType() === 'system' || $parentMessage->getMessageType() === 'command') {
+ return new DataResponse([], Http::STATUS_BAD_REQUEST);
+ }
}
$this->room->ensureOneToOneRoomIsFilled();